Mendloop Docs Request access

Root causes

Start a root cause analysis (RCA), read reports, rate them, regenerate the fix plan and export a report.

A root cause analysis reads the issue's events, your code and its history, and writes a report: the root cause with its exact line, a causal chain where every claim cites evidence, and a fix plan. Starting one returns at once with status: running; an rca.updated live event follows when it finishes. Starting an RCA reads only; nothing is written to your repositories.

The report object#

Field Type Description
id uuid Report id
issue_id uuid The issue
project_id uuid or null The issue's project
run_id uuid or null The workflow run that started it, if any
status string running, done, not_code or failed
classification string e.g. code_bug, infra, third_party, user_error
root_cause object or null {summary, location, causal_chain, confidence, suspect_commit, location_verified, proof}
root_cause.location object {repo, commit, path, line, end_line, snippet, url}: the exact line
root_cause.causal_chain object[] Ordered claims from trigger to crash: {text, citations: [{kind, ref, code}], proof}. kind is code, commit, event, breadcrumb, log, release or memory.
root_cause.confidence string high, medium or low
fix_plan object or null {summary, steps, files, alternatives, risk, regression_test}; risk is low, medium or high
reproduction object or null {outcome, reason, language, test_path, test_source, expected_exception, …}; outcome is reproduced, partial, not_reproduced or could_not_try
proof object {level, reasons}; level is proven, strong or hypothesis, computed from the evidence
similar object[] Similar past issues from the Brain
investigation_log object[] {agent, step, summary, tier, model, tokens, cost_usd, ms, source, strategy, at}
cost_usd number Model cost of the report
tokens integer Tokens used
rating integer or null The owner's 1 to 5 rating
version integer Bumps each time the fix plan is regenerated
note string or null Why the run stopped early or failed
created_at datetime Started
updated_at datetime or null Last change

Start an RCA#

POST/api/v1/orgs/{org_id}/issues/{issue_id}/rca

Starts a root cause analysis for the issue and returns the report while it runs. Audit logged.

Auth: secret key with the issues:write scope, or a session. Either way the role behind it needs issues.triage.

Path parameters

Parameter Type Required Description
org_id uuid required Organization id
issue_id uuid required Issue id

Response

The report object, with status: running.

Errors

Status Code When
404 issue_not_found No such issue in this mode, or it's in a project you can't see
Shell
curl -X POST "https://app.getmendloop.com/api/v1/orgs/ORG_ID/issues/ISSUE_ID/rca" \
  -H "Authorization: Bearer sk_test_…"
Response 202JSON
{
  "id": "0193c5b2-6e7f-7a8b-9c0d-1e2f3a4b5c6d",
  "issue_id": "0193b7e2-0a4c-7f19-b8d2-51c3e9a7f604",
  "project_id": "0193a2c4-61b0-7d3e-9a15-7c2e4f8b1d02",
  "run_id": null,
  "status": "running",
  "classification": "",
  "root_cause": null,
  "fix_plan": null,
  "reproduction": null,
  "proof": {
    "level": "hypothesis",
    "reasons": [
      "no root cause was established"
    ]
  },
  "similar": [],
  "investigation_log": [],
  "cost_usd": 0.0,
  "tokens": 0,
  "rating": null,
  "version": 1,
  "note": null,
  "created_at": "2026-11-05T09:15:00Z",
  "updated_at": "2026-11-05T09:16:12Z"
}

Get the latest RCA#

GET/api/v1/orgs/{org_id}/issues/{issue_id}/rca

The issue's latest report.

Auth: secret key with the issues:read scope, or a session. Either way the role behind it needs issues.view.

Path parameters

Parameter Type Required Description
org_id uuid required Organization id
issue_id uuid required Issue id

Response

The report object.

Errors

Status Code When
404 issue_not_found No such issue in this mode, or it's in a project you can't see
404 rca_not_found The issue has no report yet
Shell
curl "https://app.getmendloop.com/api/v1/orgs/ORG_ID/issues/ISSUE_ID/rca" \
  -H "Authorization: Bearer sk_test_…"
Response 200JSON
{
  "id": "0193c5b2-6e7f-7a8b-9c0d-1e2f3a4b5c6d",
  "issue_id": "0193b7e2-0a4c-7f19-b8d2-51c3e9a7f604",
  "project_id": "0193a2c4-61b0-7d3e-9a15-7c2e4f8b1d02",
  "run_id": null,
  "status": "done",
  "classification": "code_bug",
  "root_cause": {
    "summary": "CartItem reads item.product.id before the product has loaded.",
    "location": {
      "repo": "acme/rider-web",
      "commit": "4b8e1f2c9a7d6e5b3c1a0f9e8d7c6b5a4f3e2d1c",
      "path": "src/cart.tsx",
      "line": 42,
      "end_line": null,
      "snippet": "  const id = item.product.id;",
      "url": "https://github.com/acme/rider-web/blob/4b8e1f2/src/cart.tsx#L42"
    },
    "causal_chain": [
      {
        "text": "web@1.8.2 made product loading lazy.",
        "citations": [
          {
            "kind": "commit",
            "ref": "4b8e1f2c",
            "code": null
          }
        ],
        "proof": {
          "level": "strong",
          "reasons": [
            "cited commit"
          ]
        }
      },
      {
        "text": "CartItem renders before product is set.",
        "citations": [
          {
            "kind": "code",
            "ref": "acme/rider-web@4b8e1f2:src/cart.tsx#L42",
            "code": null
          }
        ],
        "proof": {
          "level": "strong",
          "reasons": [
            "cited code"
          ]
        }
      }
    ],
    "confidence": "high",
    "suspect_commit": "4b8e1f2c9a7d6e5b3c1a0f9e8d7c6b5a4f3e2d1c",
    "location_verified": true,
    "proof": {
      "level": "strong",
      "reasons": [
        "location verified at commit",
        "cited code"
      ]
    }
  },
  "fix_plan": {
    "summary": "Guard against a missing product in CartItem.",
    "steps": [
      "Return a skeleton row while product is undefined"
    ],
    "files": [
      "src/cart.tsx"
    ],
    "alternatives": [],
    "risk": "low",
    "regression_test": "Render CartItem with product undefined"
  },
  "reproduction": {
    "outcome": "reproduced",
    "reason": "",
    "language": "typescript",
    "test_path": "src/cart.test.tsx",
    "test_source": "…",
    "expected_exception": "TypeError"
  },
  "proof": {
    "level": "strong",
    "reasons": [
      "location verified at commit",
      "cited code"
    ]
  },
  "similar": [],
  "investigation_log": [],
  "cost_usd": 0.084,
  "tokens": 41210,
  "rating": null,
  "version": 1,
  "note": null,
  "created_at": "2026-11-05T09:15:00Z",
  "updated_at": "2026-11-05T09:16:12Z"
}

Get a report#

GET/api/v1/orgs/{org_id}/rca/{report_id}

One report by id.

Auth: secret key with the issues:read scope, or a session. Either way the role behind it needs issues.view.

Path parameters

Parameter Type Required Description
org_id uuid required Organization id
report_id uuid required Report id

Response

The report object.

Errors

Status Code When
404 rca_not_found No such report in this mode, or it's in a project you can't see
Shell
curl "https://app.getmendloop.com/api/v1/orgs/ORG_ID/rca/REPORT_ID" \
  -H "Authorization: Bearer sk_test_…"
Response 200JSON
{
  "id": "0193c5b2-6e7f-7a8b-9c0d-1e2f3a4b5c6d",
  "issue_id": "0193b7e2-0a4c-7f19-b8d2-51c3e9a7f604",
  "project_id": "0193a2c4-61b0-7d3e-9a15-7c2e4f8b1d02",
  "run_id": null,
  "status": "done",
  "classification": "code_bug",
  "root_cause": {
    "summary": "CartItem reads item.product.id before the product has loaded.",
    "location": {
      "repo": "acme/rider-web",
      "commit": "4b8e1f2c9a7d6e5b3c1a0f9e8d7c6b5a4f3e2d1c",
      "path": "src/cart.tsx",
      "line": 42,
      "end_line": null,
      "snippet": "  const id = item.product.id;",
      "url": "https://github.com/acme/rider-web/blob/4b8e1f2/src/cart.tsx#L42"
    },
    "causal_chain": [
      {
        "text": "web@1.8.2 made product loading lazy.",
        "citations": [
          {
            "kind": "commit",
            "ref": "4b8e1f2c",
            "code": null
          }
        ],
        "proof": {
          "level": "strong",
          "reasons": [
            "cited commit"
          ]
        }
      },
      {
        "text": "CartItem renders before product is set.",
        "citations": [
          {
            "kind": "code",
            "ref": "acme/rider-web@4b8e1f2:src/cart.tsx#L42",
            "code": null
          }
        ],
        "proof": {
          "level": "strong",
          "reasons": [
            "cited code"
          ]
        }
      }
    ],
    "confidence": "high",
    "suspect_commit": "4b8e1f2c9a7d6e5b3c1a0f9e8d7c6b5a4f3e2d1c",
    "location_verified": true,
    "proof": {
      "level": "strong",
      "reasons": [
        "location verified at commit",
        "cited code"
      ]
    }
  },
  "fix_plan": {
    "summary": "Guard against a missing product in CartItem.",
    "steps": [
      "Return a skeleton row while product is undefined"
    ],
    "files": [
      "src/cart.tsx"
    ],
    "alternatives": [],
    "risk": "low",
    "regression_test": "Render CartItem with product undefined"
  },
  "reproduction": {
    "outcome": "reproduced",
    "reason": "",
    "language": "typescript",
    "test_path": "src/cart.test.tsx",
    "test_source": "…",
    "expected_exception": "TypeError"
  },
  "proof": {
    "level": "strong",
    "reasons": [
      "location verified at commit",
      "cited code"
    ]
  },
  "similar": [],
  "investigation_log": [],
  "cost_usd": 0.084,
  "tokens": 41210,
  "rating": null,
  "version": 1,
  "note": null,
  "created_at": "2026-11-05T09:15:00Z",
  "updated_at": "2026-11-05T09:16:12Z"
}

Rate a report#

POST/api/v1/orgs/{org_id}/rca/{report_id}/rating

Records a 1 to 5 rating of a finished report, with an optional comment. Audit logged.

Auth: secret key with the issues:write scope, or a session. Either way the role behind it needs issues.triage.

Path parameters

Parameter Type Required Description
org_id uuid required Organization id
report_id uuid required Report id

Body (JSON)

Parameter Type Required Description
rating integer required 1 to 5
comment string optional Up to 2,000 characters

Response

The report object with rating set.

Errors

Status Code When
404 rca_not_found No such report in this mode, or it's in a project you can't see
409 rca_running The report hasn't finished yet
Shell
curl -X POST "https://app.getmendloop.com/api/v1/orgs/ORG_ID/rca/REPORT_ID/rating" \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{
    "rating": 5,
    "comment": "Exactly the line."
  }'
Response 200JSON
{
  "id": "0193c5b2-6e7f-7a8b-9c0d-1e2f3a4b5c6d",
  "issue_id": "0193b7e2-0a4c-7f19-b8d2-51c3e9a7f604",
  "project_id": "0193a2c4-61b0-7d3e-9a15-7c2e4f8b1d02",
  "run_id": null,
  "status": "done",
  "classification": "code_bug",
  "root_cause": {
    "summary": "CartItem reads item.product.id before the product has loaded.",
    "location": {
      "repo": "acme/rider-web",
      "commit": "4b8e1f2c9a7d6e5b3c1a0f9e8d7c6b5a4f3e2d1c",
      "path": "src/cart.tsx",
      "line": 42,
      "end_line": null,
      "snippet": "  const id = item.product.id;",
      "url": "https://github.com/acme/rider-web/blob/4b8e1f2/src/cart.tsx#L42"
    },
    "causal_chain": [
      {
        "text": "web@1.8.2 made product loading lazy.",
        "citations": [
          {
            "kind": "commit",
            "ref": "4b8e1f2c",
            "code": null
          }
        ],
        "proof": {
          "level": "strong",
          "reasons": [
            "cited commit"
          ]
        }
      },
      {
        "text": "CartItem renders before product is set.",
        "citations": [
          {
            "kind": "code",
            "ref": "acme/rider-web@4b8e1f2:src/cart.tsx#L42",
            "code": null
          }
        ],
        "proof": {
          "level": "strong",
          "reasons": [
            "cited code"
          ]
        }
      }
    ],
    "confidence": "high",
    "suspect_commit": "4b8e1f2c9a7d6e5b3c1a0f9e8d7c6b5a4f3e2d1c",
    "location_verified": true,
    "proof": {
      "level": "strong",
      "reasons": [
        "location verified at commit",
        "cited code"
      ]
    }
  },
  "fix_plan": {
    "summary": "Guard against a missing product in CartItem.",
    "steps": [
      "Return a skeleton row while product is undefined"
    ],
    "files": [
      "src/cart.tsx"
    ],
    "alternatives": [],
    "risk": "low",
    "regression_test": "Render CartItem with product undefined"
  },
  "reproduction": {
    "outcome": "reproduced",
    "reason": "",
    "language": "typescript",
    "test_path": "src/cart.test.tsx",
    "test_source": "…",
    "expected_exception": "TypeError"
  },
  "proof": {
    "level": "strong",
    "reasons": [
      "location verified at commit",
      "cited code"
    ]
  },
  "similar": [],
  "investigation_log": [],
  "cost_usd": 0.084,
  "tokens": 41210,
  "rating": 5,
  "version": 1,
  "note": null,
  "created_at": "2026-11-05T09:15:00Z",
  "updated_at": "2026-11-05T09:16:12Z"
}

Regenerate the fix plan#

POST/api/v1/orgs/{org_id}/rca/{report_id}/regenerate-plan

Writes a new fix plan from your feedback and bumps version. Only for a finished report with a root cause. Audit logged.

Auth: secret key with the issues:write scope, or a session. Either way the role behind it needs issues.triage.

Path parameters

Parameter Type Required Description
org_id uuid required Organization id
report_id uuid required Report id

Body (JSON)

Parameter Type Required Description
feedback string required What to change, 3 to 2,000 characters

Response

The report object with the new fix_plan and version.

Errors

Status Code When
404 rca_not_found No such report in this mode, or it's in a project you can't see
409 rca_not_done The report has no finished root cause
Shell
curl -X POST "https://app.getmendloop.com/api/v1/orgs/ORG_ID/rca/REPORT_ID/regenerate-plan" \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{
    "feedback": "Don't render a skeleton; filter the item out until it loads."
  }'
Response 200JSON
{
  "id": "0193c5b2-6e7f-7a8b-9c0d-1e2f3a4b5c6d",
  "issue_id": "0193b7e2-0a4c-7f19-b8d2-51c3e9a7f604",
  "project_id": "0193a2c4-61b0-7d3e-9a15-7c2e4f8b1d02",
  "run_id": null,
  "status": "done",
  "classification": "code_bug",
  "root_cause": {
    "summary": "CartItem reads item.product.id before the product has loaded.",
    "location": {
      "repo": "acme/rider-web",
      "commit": "4b8e1f2c9a7d6e5b3c1a0f9e8d7c6b5a4f3e2d1c",
      "path": "src/cart.tsx",
      "line": 42,
      "end_line": null,
      "snippet": "  const id = item.product.id;",
      "url": "https://github.com/acme/rider-web/blob/4b8e1f2/src/cart.tsx#L42"
    },
    "causal_chain": [
      {
        "text": "web@1.8.2 made product loading lazy.",
        "citations": [
          {
            "kind": "commit",
            "ref": "4b8e1f2c",
            "code": null
          }
        ],
        "proof": {
          "level": "strong",
          "reasons": [
            "cited commit"
          ]
        }
      },
      {
        "text": "CartItem renders before product is set.",
        "citations": [
          {
            "kind": "code",
            "ref": "acme/rider-web@4b8e1f2:src/cart.tsx#L42",
            "code": null
          }
        ],
        "proof": {
          "level": "strong",
          "reasons": [
            "cited code"
          ]
        }
      }
    ],
    "confidence": "high",
    "suspect_commit": "4b8e1f2c9a7d6e5b3c1a0f9e8d7c6b5a4f3e2d1c",
    "location_verified": true,
    "proof": {
      "level": "strong",
      "reasons": [
        "location verified at commit",
        "cited code"
      ]
    }
  },
  "fix_plan": {
    "summary": "Skip cart items whose product hasn't loaded.",
    "steps": [
      "Return a skeleton row while product is undefined"
    ],
    "files": [
      "src/cart.tsx"
    ],
    "alternatives": [],
    "risk": "low",
    "regression_test": "Render CartItem with product undefined"
  },
  "reproduction": {
    "outcome": "reproduced",
    "reason": "",
    "language": "typescript",
    "test_path": "src/cart.test.tsx",
    "test_source": "…",
    "expected_exception": "TypeError"
  },
  "proof": {
    "level": "strong",
    "reasons": [
      "location verified at commit",
      "cited code"
    ]
  },
  "similar": [],
  "investigation_log": [],
  "cost_usd": 0.084,
  "tokens": 41210,
  "rating": null,
  "version": 2,
  "note": null,
  "created_at": "2026-11-05T09:15:00Z",
  "updated_at": "2026-11-05T09:16:12Z"
}

Export a report#

GET/api/v1/orgs/{org_id}/rca/{report_id}/export

The report as a document. html is laid out for A4, so a browser's Print → Save as PDF gives a clean PDF. md is the same content as Markdown, to paste into a ticket or chat. There is no server-side PDF.

Auth: secret key with the issues:read scope, or a session. Either way the role behind it needs issues.view.

Path parameters

Parameter Type Required Description
org_id uuid required Organization id
report_id uuid required Report id

Query parameters

Parameter Type Required Description
format string optional html (default) or md

Response

text/html or text/markdown.

Errors

Status Code When
404 rca_not_found No such report in this mode, or it's in a project you can't see
Shell
curl "https://app.getmendloop.com/api/v1/orgs/ORG_ID/rca/REPORT_ID/export?format=md" \
  -H "Authorization: Bearer sk_test_…"
Response 200Text
# RIDER-12: TypeError: Cannot read properties of undefined (reading 'id')
…