Menú

Referencia de la API · Dashboards

Métricas personalizadas

dashboards · custom_metrics · 4 operaciones

GET/v1/dashboards/custom-metrics

List custom metrics

dashboards.custom_metrics.list

LecturaIdempotenteDesde 2026-11-01

Lists all the workspace's custom metrics (from an account, its workspace's; up to 50), by name: formula and its readable text, format (number, currency, percent), decimals, whether higher is better, platforms, is_blended (more than one platform: usable in KPIs and charts, not in tables) and who created it (created_by_id, created_by_name). Widgets reference a custom metric by its public_id (custom:<id>).

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

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

Parámetros

Sin parámetros.

Respuesta

dataarray<object>

The custom metrics, by name.

Errores

Ejemplo

curl "https://api.mb-suite.com/v1/dashboards/custom-metrics" \
  -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/dashboards/custom-metrics" \
  -H "Authorization: Bearer $MB_TEST_KEY"
POST/v1/dashboards/custom-metrics

Create a custom metric

dashboards.custom_metrics.create

EscrituraDesde 2026-11-01

Creates a custom metric in the workspace (not in an account: workspace_only) with a unique name (max 60), optional description, formula, format, decimals (0-4) and higher_is_better. The formula is a tree: {kind: 'metric', metric_id, platform} (a metric id of that platform's registry, numeric), {kind: 'constant', value}, {kind: 'binary', op: '+'|'-'|'*'|'/', left, right} or {kind: 'group', child} (parentheses); up to 20 metrics and 12 levels, never another custom metric. Up to 50 per workspace. Returns the new id; widgets use custom:<id>. Requires edit access to Dashboards in the workspace.

Alcance
dashboards:write
Permiso
Editar en el módulo
Tool del MCP
dashboards_custom_metrics_createEn la superficie completa; en la compacta, mb_execute_operation con id: "dashboards.custom_metrics.create".

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

Parámetros

namestringcuerporequerido

A unique name in the workspace (up to 60 characters).

formulaanycuerporequerido

The formula, as a tree of nodes (see the operation's description).

formatenumcuerporequerido

number, currency or percent.

Valores: number, currency, percent

decimalsintegercuerporequerido

Decimals shown, 0 to 4.

higher_is_betterbooleancuerporequerido

Whether going up is good (green) or bad (red).

descriptionstringcuerpoopcional

A description (up to 200 characters).

Respuesta

metric_idstring

Errores

Ejemplo

curl -X POST "https://api.mb-suite.com/v1/dashboards/custom-metrics" \
  -H "Authorization: Bearer $MB_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "name": "NAME",
  "formula": "FORMULA",
  "format": "number",
  "decimals": 0,
  "higher_is_better": 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/dashboards/custom-metrics" \
  -H "Authorization: Bearer $MB_TEST_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "name": "NAME",
  "formula": "FORMULA",
  "format": "number",
  "decimals": 0,
  "higher_is_better": true
}'
PATCH/v1/dashboards/custom-metrics/{metric_id}

Update a custom metric

dashboards.custom_metrics.update

EscrituraIdempotenteDesde 2026-11-01

Updates any of the name, description (empty clears it), formula, format, decimals and higher_is_better of a workspace custom metric; what is not sent is kept. The formula is a tree: {kind: 'metric', metric_id, platform} (a metric id of that platform's registry, numeric), {kind: 'constant', value}, {kind: 'binary', op: '+'|'-'|'*'|'/', left, right} or {kind: 'group', child} (parentheses); up to 20 metrics and 12 levels, never another custom metric. Every widget that uses it shows the new definition. Returns the updated metric. Requires edit access to Dashboards in the workspace.

Alcance
dashboards:write
Permiso
Editar en el módulo
Tool del MCP
dashboards_custom_metrics_updateEn la superficie completa; en la compacta, mb_execute_operation con id: "dashboards.custom_metrics.update".

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

Parámetros

metric_idstringrutarequerido

The custom metric id (dashboards.custom_metrics.list; without the custom: prefix).

namestringcuerpoopcional

A unique name in the workspace (up to 60 characters).

descriptionstringcuerpoopcional

A new description (empty clears it).

formulaanycuerpoopcional

The new formula, as a tree of nodes (see the operation's description).

formatenumcuerpoopcional

number, currency or percent.

Valores: number, currency, percent

decimalsintegercuerpoopcional

Decimals shown, 0 to 4.

higher_is_betterbooleancuerpoopcional

Whether going up is good (green) or bad (red).

Respuesta

metricobject

Errores

Ejemplo

curl -X PATCH "https://api.mb-suite.com/v1/dashboards/custom-metrics/{metric_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 -X PATCH "https://api.mb-suite.com/v1/dashboards/custom-metrics/{metric_id}" \
  -H "Authorization: Bearer $MB_TEST_KEY"
DELETE/v1/dashboards/custom-metrics/{metric_id}

Delete a custom metric

dashboards.custom_metrics.delete

IrreversibleDesde 2026-11-01

Deletes a workspace custom metric. It goes to the 30-day trash; widgets and report blocks that use it show an error until it is restored. Outside the screen it requires a dry run and a confirm_token, except a plain REST DELETE with a key allowed to delete. Requires edit access to Dashboards in the workspace.

Instrucciones para agentes

Warn the person that every widget using this metric breaks until it is restored.

Con una API key, este DELETE se ejecuta directo: el registro queda 30 días en la papelera y la respuesta trae su trash_item_id. Con un token OAuth, y por el MCP, pide dry_run → confirm_token.

Alcance
dashboards:write y «Permitir eliminar» (dashboards:delete en OAuth)
Permiso
Editar en el módulo
Tool del MCP
dashboards_custom_metrics_deleteEn la superficie completa; en la compacta, mb_execute_operation con id: "dashboards.custom_metrics.delete".

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

Parámetros

metric_idstringrutarequerido

The custom metric id (dashboards.custom_metrics.list; without the custom: prefix).

Respuesta

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.

Errores

Ejemplo

curl -X DELETE "https://api.mb-suite.com/v1/dashboards/custom-metrics/{metric_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 -X DELETE "https://api.mb-suite.com/v1/dashboards/custom-metrics/{metric_id}" \
  -H "Authorization: Bearer $MB_TEST_KEY"