Menú

Referencia de la API · CRM

IA

crm · ai · 6 operaciones

GET/v1/crm/ai/performance

Performance of the CRM AI team

crm.ai.performance

LecturaIdempotenteDesde 2026-11-01

Performance of the CRM AI team (operative positions such as the Setter, the Qualifier or the Seller) for a period, start and end (both required, epoch ms): the roster, AI conversations (states) created in the period and how many are still active, meetings booked vs a human baseline (won rate of the deals created in the period with a human owner), average and median time to booking vs time to win, and why finished conversations were handed off or closed (explicit request, stalled, guardrail, no AI credits, disqualified). Reads at most 2,000 AI states and 2,000 deals; truncated: true when a cap was hit, and truncation says which: states (the AI side counts only the first 2,000 states of the period) or human_deals (the human baseline comes from the first 2,000 deals of the period, not all of them, so its rate is not comparable: narrow the period). Org-wide numbers, as in the app. Use crm.ai_team.positions.list for the positions themselves.

Alcance
crm:read
Permiso
Ver el módulo · Acción del CRM: view_performance
Tool del MCP
crm_ai_performanceEn la superficie completa; en la compacta, mb_execute_operation con id: "crm.ai.performance".

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

Parámetros

startintegerqueryrequerido

Start of the date range, epoch ms (UTC).

endintegerqueryrequerido

End of the date range, epoch ms (UTC), not before start.

Respuesta

rosterarray<object>
total_statesnumber
active_statesnumber
conversionobject
booking_timeobject
handoff_reasonsarray<object>
truncationobject

Which read hit its 2,000 cap: states (the AI side) or human_deals (the human baseline, then not comparable).

truncatedboolean

Errores

Ejemplo

curl "https://api.mb-suite.com/v1/crm/ai/performance?start=0&end=0" \
  -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/ai/performance?start=0&end=0" \
  -H "Authorization: Bearer $MB_TEST_KEY"
POST/v1/crm/deals/{deal_id}/ai-coach

Run the AI Deal Coach on a deal

crm.ai.deal_coach

EscrituraDesde 2026-11-01

Runs the CRM's AI Deal Coach on one deal and saves its note on the deal (ai_coach_note, the note the deal's Coach card shows; it replaces the previous one). The coach is the AI agent chosen in CRM settings → AI scoring → Coach, with that block's focus, offer context and things to avoid; it reads the deal (stage and days in it, value, owner, AI score, custom fields), its company, up to 6 contacts and the last 8 activities. Returns the saved note plus its parts: summary, next_best_action, 2-3 recommendations with priority and a risk_level (low, medium, high). Use it when asked what to do next with a deal. It does not move, edit or contact anything. language (es, en, pt-BR) defaults to the caller's language. The coach must be turned on (409 coach_not_configured). Spends the organization's AI credits, charged by the tokens the model actually used, its thinking included, at the price of the model that answered (a fallback model, if one did): before calling the AI it checks that the caller's credit pool covers the call with the model that will run, and if it does not it fails with 402 ai_credits_exhausted (details.reason: insufficient_credits, category_budget or personal_limit; details.detail, when the extra credits stop it: extras_limit, the owner's monthly cap reached, or frozen) without calling the AI. An answer the model gave is charged even when it cannot be used, unless this operation says otherwise; a model that fails (an error of the AI provider) is not charged. The SDKs do not retry a 502 ai_generation_failed on their own: retrying calls the AI again, and is charged again if the AI answers. Not available in the practice organization (test keys): 409 sandbox_external_unavailable. If the AI fails, or answers with an empty note (an answer that cannot be read at all counts as empty), nothing is saved and nothing is charged (502 ai_generation_failed, or 429 external_rate_limited when the AI provider is limiting); an answer that comes back malformed is charged and nothing is saved either (502 ai_generation_failed). Takes several seconds. Not idempotent: send an Idempotency-Key to retry safely. Requires edit_deal; a seller with restricted scope only coaches deals they can work. With TikTok, 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).

Instrucciones para agentes

Lead with the next best action, then list the recommendations briefly. They are suggestions: do not act on them without the person's OK.

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
Permiso
Editar en el módulo
Tool del MCP
crm_ai_deal_coachEn la superficie completa; en la compacta, mb_execute_operation con id: "crm.ai.deal_coach".

Costo declarado: hasta 50 lecturas y 1 escrituras por llamada (cuentan en el cupo diario). Toca una plataforma externa (ai): cuenta en el cupo de operaciones externas.

Parámetros

deal_idstringrutarequerido

The deal (crm.deals.list).

languageenumcuerpoopcional

The language of the answer: es, en or pt-BR; without it, the caller's.

Valores: es, en, pt-BR

Respuesta

ai_coach_notestring
ai_coach_updated_atnumber
modelstring
risk_levelenum

Valores: low, medium, high

summarystring
next_best_actionstring
recommendationsarray<object>

Errores

Ejemplo

curl -X POST "https://api.mb-suite.com/v1/crm/deals/{deal_id}/ai-coach" \
  -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. En la práctica esta operación no se simula (toca otra plataforma): responde 409 sandbox_external_unavailable.

POST/v1/crm/deals/{deal_id}/ai-email-draft

Draft an email for a deal with AI

crm.ai.draft_email

EscrituraDesde 2026-11-01

Writes a draft of one outbound sales email for a deal with AI (Gemini Pro) and returns it: subject, plain_body and a simple html_body (p, br, strong, em, a, lists; sanitized). It uses the deal (value, status, owner, company, primary contact and email) and the subjects of its last 5 activities (never email bodies), with a tone (formal, casual, direct; default direct), an intent (follow_up by default, intro, proposal, check_in, break_up, demo_request or custom), optional additional_context (up to 1,000 characters) and an optional seed_subject to adapt. language (es, en, pt-BR) defaults to the caller's language. It saves nothing and sends nothing: to send it use crm.email.send after the person reviews it. Spends the organization's AI credits, charged by the tokens the model actually used, its thinking included, at the price of the model that answered (a fallback model, if one did): before calling the AI it checks that the caller's credit pool covers the call with the model that will run, and if it does not it fails with 402 ai_credits_exhausted (details.reason: insufficient_credits, category_budget or personal_limit; details.detail, when the extra credits stop it: extras_limit, the owner's monthly cap reached, or frozen) without calling the AI. An answer the model gave is charged even when it cannot be used, unless this operation says otherwise; a model that fails (an error of the AI provider) is not charged. The SDKs do not retry a 502 ai_generation_failed on their own: retrying calls the AI again, and is charged again if the AI answers. Not available in the practice organization (test keys): 409 sandbox_external_unavailable. If the AI fails or returns an empty draft (an answer that cannot be read counts as empty), nothing is charged (502 ai_generation_failed, or 429 external_rate_limited when the AI provider is limiting). Not idempotent: send an Idempotency-Key to retry safely. Requires send_email on the deal. With TikTok, 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).

Instrucciones para agentes

Show the draft (subject and body) to the person for review. Never send it without their explicit OK; when they approve, send it with crm.email.send.

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
Permiso
Editar en el módulo
Tool del MCP
crm_ai_draft_emailEn la superficie completa; en la compacta, mb_execute_operation con id: "crm.ai.draft_email".

Costo declarado: hasta 25 lecturas y 3 escrituras por llamada (cuentan en el cupo diario). Toca una plataforma externa (ai): cuenta en el cupo de operaciones externas.

Parámetros

deal_idstringrutarequerido

The deal the email is for (crm.deals.list): its person, company and history give the context.

toneenumcuerpoopcional

The tone: formal, casual or direct (the default).

Valores: formal, casual, direct · Por defecto: "direct"

languageenumcuerpoopcional

The language of the answer: es, en or pt-BR; without it, the caller's.

Valores: es, en, pt-BR

intentenumcuerpoopcional

What the email is for: follow_up (the default), intro, proposal, check_in, break_up, demo_request or custom (say it in additional_context).

Valores: follow_up, intro, proposal, check_in, break_up, demo_request, custom · Por defecto: "follow_up"

additional_contextstringcuerpoopcional

Anything else the draft must take into account (up to 1,000 characters).

seed_subjectstringcuerpoopcional

A subject to start from; the draft may refine it.

Respuesta

subjectstring
html_bodystring
plain_bodystring
modelstring

Errores

Ejemplo

curl -X POST "https://api.mb-suite.com/v1/crm/deals/{deal_id}/ai-email-draft" \
  -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. En la práctica esta operación no se simula (toca otra plataforma): responde 409 sandbox_external_unavailable.

POST/v1/crm/deals/{deal_id}/ai-score

Score a deal with AI

crm.ai.score_deal

EscrituraDesde 2026-11-01

Scores a deal (0-100) with the AI agent and criteria of the deals block in CRM settings → AI scoring, using the firmographics of one of its persons (person_id; default the deal's primary person), its source channel and value, and saves the result on the deal (ai_scoring, and ai_score for sorting), replacing the previous score. The score is a hybrid: 40% rules (email, phone, company, role, source) and 60% AI; it returns score, rules_score, ai_score, recommendation (qualified, needs_review, not_qualified), a short reasoning and the rule signals. If the AI fails, the score is rules only (it says so in reasoning) and nothing is charged; if the AI answers with something that cannot be used, the score is rules only too and that answer is charged. It runs even if automatic deal scoring is off. Errors: 409 deal_without_person when the deal has no primary person and no person_id is sent; 400 person_not_in_deal when person_id is not linked to the deal. Spends the organization's AI credits, charged by the tokens the model actually used, its thinking included, at the price of the model that answered (a fallback model, if one did): before calling the AI it checks that the caller's credit pool covers the call with the model that will run, and if it does not it fails with 402 ai_credits_exhausted (details.reason: insufficient_credits, category_budget or personal_limit; details.detail, when the extra credits stop it: extras_limit, the owner's monthly cap reached, or frozen) without calling the AI. An answer the model gave is charged even when it cannot be used, unless this operation says otherwise; a model that fails (an error of the AI provider) is not charged. The SDKs do not retry a 502 ai_generation_failed on their own: retrying calls the AI again, and is charged again if the AI answers. Not available in the practice organization (test keys): 409 sandbox_external_unavailable. Not idempotent: send an Idempotency-Key to retry safely. Requires edit_deal; a seller with restricted scope only scores deals they can work. With TikTok, 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).

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
Permiso
Editar en el módulo
Tool del MCP
crm_ai_score_dealEn la superficie completa; en la compacta, mb_execute_operation con id: "crm.ai.score_deal".

Costo declarado: hasta 20 lecturas y 1 escrituras por llamada (cuentan en el cupo diario). Toca una plataforma externa (ai): cuenta en el cupo de operaciones externas.

Parámetros

deal_idstringrutarequerido

The deal (crm.deals.list).

person_idstringcuerpoopcional

The deal's person whose company data the score uses; without it, the deal's primary person.

Respuesta

scorenumber
rules_scorenumber
ai_scorenumber
reasoningstring
signalsarray<string>
scored_atnumber
modelstring
recommendationstring
agent_idstring

Errores

Ejemplo

curl -X POST "https://api.mb-suite.com/v1/crm/deals/{deal_id}/ai-score" \
  -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. En la práctica esta operación no se simula (toca otra plataforma): responde 409 sandbox_external_unavailable.

POST/v1/crm/prospects/{prospect_id}/ai-score

Score a prospect with AI

crm.ai.score_prospect

EscrituraDesde 2026-11-01

Scores an inbox prospect (0-100) with the AI agent and criteria of the prospects block in CRM settings → AI scoring, using the linked contact's firmographics (when there is one), the prospect's title, custom fields, source channel and value, and saves the result on the prospect (ai_scoring, and ai_score for sorting), replacing the previous score. Hybrid: 40% rules and 60% AI; returns score, rules_score, ai_score, recommendation (qualified, needs_review, not_qualified), a short reasoning and the rule signals. If the AI fails, the score is rules only and nothing is charged; if the AI answers with something that cannot be used, the score is rules only too and that answer is charged. It runs even if automatic scoring is off for the prospect's lead source. For several prospects use crm.ai.bulk.score_prospects. Spends the organization's AI credits, charged by the tokens the model actually used, its thinking included, at the price of the model that answered (a fallback model, if one did): before calling the AI it checks that the caller's credit pool covers the call with the model that will run, and if it does not it fails with 402 ai_credits_exhausted (details.reason: insufficient_credits, category_budget or personal_limit; details.detail, when the extra credits stop it: extras_limit, the owner's monthly cap reached, or frozen) without calling the AI. An answer the model gave is charged even when it cannot be used, unless this operation says otherwise; a model that fails (an error of the AI provider) is not charged. The SDKs do not retry a 502 ai_generation_failed on their own: retrying calls the AI again, and is charged again if the AI answers. Not available in the practice organization (test keys): 409 sandbox_external_unavailable. Not idempotent: send an Idempotency-Key to retry safely. Requires edit_prospect. With TikTok, 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).

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
Permiso
Editar en el módulo
Tool del MCP
crm_ai_score_prospectEn la superficie completa; en la compacta, mb_execute_operation con id: "crm.ai.score_prospect".

Costo declarado: hasta 20 lecturas y 1 escrituras por llamada (cuentan en el cupo diario). Toca una plataforma externa (ai): cuenta en el cupo de operaciones externas.

Parámetros

prospect_idstringrutarequerido

The prospect (crm.prospects.list).

Respuesta

scorenumber
rules_scorenumber
ai_scorenumber
reasoningstring
signalsarray<string>
scored_atnumber
modelstring
recommendationstring
agent_idstring

Errores

Ejemplo

curl -X POST "https://api.mb-suite.com/v1/crm/prospects/{prospect_id}/ai-score" \
  -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. En la práctica esta operación no se simula (toca otra plataforma): responde 409 sandbox_external_unavailable.

POST/v1/crm/prospects/bulk/ai-score

Score many prospects with AI

crm.ai.bulk.score_prospects

EscrituraMasiva · hasta 50Desde 2026-11-01

Scores up to 50 prospects with AI, like crm.ai.score_prospect one by one (5 at a time; repeated ids count once), and saves each score on its prospect. Ids that do not exist, and prospects the matrix does not let the caller edit (another person's, for a seller), are skipped. Returns scored, failed (everything not scored) and one row per id with its status (scored, not_found, denied, failed) and score. Spends the organization's AI credits, charged by the tokens the model actually used, its thinking included, at the price of the model that answered (a fallback model, if one did): before calling the AI it checks that the caller's credit pool covers the call with the model that will run, and if it does not it fails with 402 ai_credits_exhausted (details.reason: insufficient_credits, category_budget or personal_limit; details.detail, when the extra credits stop it: extras_limit, the owner's monthly cap reached, or frozen) without calling the AI. An answer the model gave is charged even when it cannot be used, unless this operation says otherwise; a model that fails (an error of the AI provider) is not charged. The SDKs do not retry a 502 ai_generation_failed on their own: retrying calls the AI again, and is charged again if the AI answers. Not available in the practice organization (test keys): 409 sandbox_external_unavailable. The credit check covers the whole batch before the first call. Bulk: outside the app it needs a dry run (it previews how many will be scored, which are skipped and the estimated credits, without calling the AI) and then the confirm_token. Takes up to a minute with 50 prospects. Not idempotent: send an Idempotency-Key to retry safely. Requires edit access to the CRM; edit_prospect is checked per prospect.

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
Permiso
Editar en el módulo
Tool del MCP
crm_ai_bulk_score_prospectsEn la superficie completa; en la compacta, mb_execute_operation con id: "crm.ai.bulk.score_prospects".

Costo declarado: hasta 320 lecturas y 50 escrituras por llamada (cuentan en el cupo diario). Toca una plataforma externa (ai): cuenta en el cupo de operaciones externas.

Parámetros

prospect_idsarray<string>cuerporequerido

The prospects to score (1 to 50, ids of crm.prospects.list).

Respuesta

scorednumber
failednumber
resultsarray<object>

Errores

Ejemplo

curl -X POST "https://api.mb-suite.com/v1/crm/prospects/bulk/ai-score" \
  -H "Authorization: Bearer $MB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "prospect_ids": [
    "PROSPECT_ID"
  ],
  "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. En la práctica esta operación no se simula (toca otra plataforma): responde 409 sandbox_external_unavailable.