Workflows and runs
Workflows, versions, templates, validation, publishing, dry runs, and the runs they produce.
A workflow is YAML: a trigger (such as issue.created) and steps (triage, investigate, ask for approval, fix,
open a ticket). Each edit makes a numbered version; one version is live, one may be the test version, and old
ones are archived. Workflows are shared by both modes; runs belong to the mode they ran in.
Reading needs issues.view (keys: issues:read). Drafting, dry runs, cancelling and retrying need
workflows.draft; publishing, rollback and delete need workflows.publish; turning a workflow off needs
safety.switches. Changes need a signed-in session. run.updated and step.updated live
events follow runs as they go.
List workflows#
/api/v1/orgs/{org_id}/workflowsWorkflows with their 7-day stats. Returns a plain JSON array.
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 |
Response
| Field | Type | Description |
|---|---|---|
id |
uuid | Workflow id |
name, description |
string | Name and description |
template_id |
string or null | Template it came from |
trigger_summary |
string | The trigger in words |
live_version, draft_version, test_version |
integer or null | Version numbers |
live_version_id, draft_version_id |
uuid or null | Version ids |
enabled |
boolean | false: the kill switch is on; no new runs, and runs in flight pause |
disabled_reason, disabled_at |
string, datetime or null | Why and when it was turned off |
stats_7d |
object | {runs, success_rate, avg_cost_usd}; success_rate is null when no run finished |
last_run_at |
datetime or null | Latest run |
created_at, updated_at |
datetime | Timestamps |
curl "https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows" \
-H "Authorization: Bearer sk_test_…"const res = await fetch("https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows", {
headers: { Authorization: "Bearer sk_test_…" },
});
if (!res.ok) throw new Error((await res.json()).error.message);
const data = await res.json();import requests
resp = requests.get(
"https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows",
headers={"Authorization": "Bearer sk_test_…"},
timeout=30,
)
resp.raise_for_status()
data = resp.json()[
{
"id": "0193a9e0-4c5d-7e6f-8a7b-9c0d1e2f3a4b",
"name": "Crash to PR",
"description": "Triage, investigate, ask the owner, fix and open a PR.",
"template_id": "crash_to_pr",
"trigger_summary": "When a new issue appears in live mode",
"live_version": 3,
"draft_version": 4,
"test_version": 4,
"live_version_id": "0193a9e0-5d6e-7f7a-9b8c-0d1e2f3a4b5c",
"draft_version_id": "0193c5a0-2b3c-7d4e-9f5a-6b7c8d9e0f1a",
"enabled": true,
"disabled_reason": null,
"disabled_at": null,
"stats_7d": {
"runs": 37,
"success_rate": 0.89,
"avg_cost_usd": 0.21
},
"last_run_at": "2026-11-05T09:15:00Z",
"created_at": "2026-09-20T12:00:00Z",
"updated_at": "2026-11-01T16:40:00Z"
}
]Create a workflow#
/api/v1/orgs/{org_id}/workflowsCreates a workflow, empty or from a template. Audit logged.
Auth: session only. Secret keys get 403 api_key_not_allowed. The role needs workflows.draft.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
org_id |
uuid | required | Organization id |
Body (JSON)
| Parameter | Type | Required | Description |
|---|---|---|---|
name |
string | required | 1 to 200 characters |
from_template |
string | optional | Template id from List templates |
description |
string | optional | Up to 5,000 characters |
Response
The workflow.
Errors
| Status | Code | When |
|---|---|---|
| 404 | template_not_found |
No such template |
curl -X POST "https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows" \
--cookie "ml_session=…" \
-H "Content-Type: application/json" \
-d '{
"name": "Crash to PR",
"from_template": "crash_to_pr"
}'const res = await fetch("https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows", {
method: "POST",
headers: { Cookie: "ml_session=…", "Content-Type": "application/json" },
body: JSON.stringify({
"name": "Crash to PR",
"from_template": "crash_to_pr"
}),
});
if (!res.ok) throw new Error((await res.json()).error.message);
const data = await res.json();import requests
resp = requests.post(
"https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows",
cookies={"ml_session": "…"},
json={
"name": "Crash to PR",
"from_template": "crash_to_pr"
},
timeout=30,
)
resp.raise_for_status()
data = resp.json(){
"id": "0193a9e0-4c5d-7e6f-8a7b-9c0d1e2f3a4b",
"name": "Crash to PR",
"description": "Triage, investigate, ask the owner, fix and open a PR.",
"template_id": "crash_to_pr",
"trigger_summary": "When a new issue appears in live mode",
"live_version": null,
"draft_version": 1,
"test_version": null,
"live_version_id": null,
"draft_version_id": "0193c5a0-2b3c-7d4e-9f5a-6b7c8d9e0f1a",
"enabled": true,
"disabled_reason": null,
"disabled_at": null,
"stats_7d": {
"runs": 0,
"success_rate": null,
"avg_cost_usd": 0.0
},
"last_run_at": null,
"created_at": "2026-09-20T12:00:00Z",
"updated_at": "2026-11-01T16:40:00Z"
}Get a workflow#
/api/v1/orgs/{org_id}/workflows/{workflow_id}One workflow.
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 |
workflow_id |
uuid | required | Workflow id |
Response
The workflow.
Errors
| Status | Code | When |
|---|---|---|
| 404 | workflow_not_found |
No such workflow |
curl "https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID" \
-H "Authorization: Bearer sk_test_…"const res = await fetch("https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID", {
headers: { Authorization: "Bearer sk_test_…" },
});
if (!res.ok) throw new Error((await res.json()).error.message);
const data = await res.json();import requests
resp = requests.get(
"https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID",
headers={"Authorization": "Bearer sk_test_…"},
timeout=30,
)
resp.raise_for_status()
data = resp.json(){
"id": "0193a9e0-4c5d-7e6f-8a7b-9c0d1e2f3a4b",
"name": "Crash to PR",
"description": "Triage, investigate, ask the owner, fix and open a PR.",
"template_id": "crash_to_pr",
"trigger_summary": "When a new issue appears in live mode",
"live_version": 3,
"draft_version": 4,
"test_version": 4,
"live_version_id": "0193a9e0-5d6e-7f7a-9b8c-0d1e2f3a4b5c",
"draft_version_id": "0193c5a0-2b3c-7d4e-9f5a-6b7c8d9e0f1a",
"enabled": true,
"disabled_reason": null,
"disabled_at": null,
"stats_7d": {
"runs": 37,
"success_rate": 0.89,
"avg_cost_usd": 0.21
},
"last_run_at": "2026-11-05T09:15:00Z",
"created_at": "2026-09-20T12:00:00Z",
"updated_at": "2026-11-01T16:40:00Z"
}Update a workflow#
/api/v1/orgs/{org_id}/workflows/{workflow_id}Renames or describes a workflow, or turns it off and on. Turning it off is the kill switch: no new runs start and runs in flight pause until it is on again. Audit logged.
Auth: session only. Secret keys get 403 api_key_not_allowed. The role needs workflows.draft.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
org_id |
uuid | required | Organization id |
workflow_id |
uuid | required | Workflow id |
Body (JSON)
| Parameter | Type | Required | Description |
|---|---|---|---|
name |
string | optional | 1 to 200 characters |
description |
string | optional | Up to 5,000 characters |
enabled |
boolean | optional | false turns the kill switch on (needs safety.switches) |
reason |
string | optional | Why, up to 1,000 characters |
Response
The workflow.
Errors
| Status | Code | When |
|---|---|---|
| 404 | workflow_not_found |
No such workflow |
| 422 | reason_required |
enabled: false without a reason |
curl -X PATCH "https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID" \
--cookie "ml_session=…" \
-H "Content-Type: application/json" \
-d '{
"enabled": false,
"reason": "Pausing during the payments migration"
}'const res = await fetch("https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID", {
method: "PATCH",
headers: { Cookie: "ml_session=…", "Content-Type": "application/json" },
body: JSON.stringify({
"enabled": false,
"reason": "Pausing during the payments migration"
}),
});
if (!res.ok) throw new Error((await res.json()).error.message);
const data = await res.json();import requests
resp = requests.patch(
"https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID",
cookies={"ml_session": "…"},
json={
"enabled": False,
"reason": "Pausing during the payments migration"
},
timeout=30,
)
resp.raise_for_status()
data = resp.json(){
"id": "0193a9e0-4c5d-7e6f-8a7b-9c0d1e2f3a4b",
"name": "Crash to PR",
"description": "Triage, investigate, ask the owner, fix and open a PR.",
"template_id": "crash_to_pr",
"trigger_summary": "When a new issue appears in live mode",
"live_version": 3,
"draft_version": 4,
"test_version": 4,
"live_version_id": "0193a9e0-5d6e-7f7a-9b8c-0d1e2f3a4b5c",
"draft_version_id": "0193c5a0-2b3c-7d4e-9f5a-6b7c8d9e0f1a",
"enabled": false,
"disabled_reason": "Pausing during the payments migration",
"disabled_at": "2026-11-05T10:00:00Z",
"stats_7d": {
"runs": 37,
"success_rate": 0.89,
"avg_cost_usd": 0.21
},
"last_run_at": "2026-11-05T09:15:00Z",
"created_at": "2026-09-20T12:00:00Z",
"updated_at": "2026-11-01T16:40:00Z"
}Delete a workflow#
/api/v1/orgs/{org_id}/workflows/{workflow_id}Deletes a workflow. Audit logged.
Auth: session only. Secret keys get 403 api_key_not_allowed. The role needs workflows.publish.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
org_id |
uuid | required | Organization id |
workflow_id |
uuid | required | Workflow id |
Errors
| Status | Code | When |
|---|---|---|
| 404 | workflow_not_found |
No such workflow |
| 409 | workflow_has_active_runs |
Runs of it are still going |
curl -X DELETE "https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID" \
--cookie "ml_session=…"const res = await fetch("https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID", {
method: "DELETE",
headers: { Cookie: "ml_session=…" },
});
if (!res.ok) throw new Error((await res.json()).error.message);import requests
resp = requests.delete(
"https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID",
cookies={"ml_session": "…"},
timeout=30,
)
resp.raise_for_status()(empty body)List templates#
/api/v1/orgs/{org_id}/workflow-templatesBuilt-in templates, such as Crash to PR. Returns a plain JSON array.
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 |
Response
| Field | Type | Description |
|---|---|---|
id |
string | Template id |
name |
string | Name |
description |
string | What it does |
trigger_summary |
string | Trigger in words |
outcome_summary |
string | Outcome in words |
yaml |
string | The workflow YAML |
curl "https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflow-templates" \
-H "Authorization: Bearer sk_test_…"const res = await fetch("https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflow-templates", {
headers: { Authorization: "Bearer sk_test_…" },
});
if (!res.ok) throw new Error((await res.json()).error.message);
const data = await res.json();import requests
resp = requests.get(
"https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflow-templates",
headers={"Authorization": "Bearer sk_test_…"},
timeout=30,
)
resp.raise_for_status()
data = resp.json()[
{
"id": "crash_to_pr",
"name": "Crash to PR",
"description": "Triage, investigate, ask the owner, fix and open a PR.",
"trigger_summary": "When a new issue appears",
"outcome_summary": "A verified pull request",
"yaml": "name: Crash to PR\non: issue.created\nsteps:\n - id: triage\n action: issue.triage\n …"
}
]List actions#
/api/v1/orgs/{org_id}/workflow-actionsThe actions steps can use, for the builder palette. Returns a plain JSON array.
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 |
Response
| Field | Type | Description |
|---|---|---|
name |
string | e.g. issue.triage, ticket.create |
kind |
string | action, ai, gate, condition, control or trigger |
label, group, description |
string | For display |
writes |
boolean | Writes outside Mendloop (simulated in dry runs and test mode without a target) |
permission |
string or null | Permission needed to publish a workflow using it |
params_schema |
object | JSON Schema of the step's parameters |
curl "https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflow-actions" \
-H "Authorization: Bearer sk_test_…"const res = await fetch("https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflow-actions", {
headers: { Authorization: "Bearer sk_test_…" },
});
if (!res.ok) throw new Error((await res.json()).error.message);
const data = await res.json();import requests
resp = requests.get(
"https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflow-actions",
headers={"Authorization": "Bearer sk_test_…"},
timeout=30,
)
resp.raise_for_status()
data = resp.json()[
{
"name": "ticket.create",
"kind": "action",
"label": "Create ticket",
"group": "Tickets",
"writes": true,
"description": "Create a ticket in the project's default tracker",
"permission": null,
"params_schema": {
"type": "object",
"properties": {
"connection_id": {
"type": "string"
}
}
}
}
]Validate YAML#
/api/v1/orgs/{org_id}/workflows/validateChecks workflow YAML and returns its graph, without saving anything.
Auth: session only. Secret keys get 403 api_key_not_allowed. The role needs workflows.draft.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
org_id |
uuid | required | Organization id |
Body (JSON)
| Parameter | Type | Required | Description |
|---|---|---|---|
yaml |
string | required | Up to 200,000 characters |
Response
| Field | Type | Description |
|---|---|---|
valid |
boolean | Whether it compiles |
errors |
object[] | {line, column, message} |
steps |
integer | Number of steps |
graph |
object | {nodes: [{id, kind, label, action, line, group}], edges: [{from, to, label}]} |
curl -X POST "https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/validate" \
--cookie "ml_session=…" \
-H "Content-Type: application/json" \
-d '{
"yaml": "name: Triage only\non: issue.created\nsteps:\n - id: triage\n action: issue.triage\n"
}'const res = await fetch("https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/validate", {
method: "POST",
headers: { Cookie: "ml_session=…", "Content-Type": "application/json" },
body: JSON.stringify({
"yaml": "name: Triage only\non: issue.created\nsteps:\n - id: triage\n action: issue.triage\n"
}),
});
if (!res.ok) throw new Error((await res.json()).error.message);
const data = await res.json();import requests
resp = requests.post(
"https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/validate",
cookies={"ml_session": "…"},
json={
"yaml": "name: Triage only\non: issue.created\nsteps:\n - id: triage\n action: issue.triage\n"
},
timeout=30,
)
resp.raise_for_status()
data = resp.json(){
"valid": true,
"errors": [],
"steps": 1,
"graph": {
"nodes": [
{
"id": "trigger",
"kind": "trigger",
"label": "issue.created",
"action": null,
"line": 2,
"group": null
},
{
"id": "triage",
"kind": "action",
"label": "Triage",
"action": "issue.triage",
"line": 5,
"group": null
}
],
"edges": [
{
"from": "trigger",
"to": "triage",
"label": null
}
]
}
}Versions#
List versions#
/api/v1/orgs/{org_id}/workflows/{workflow_id}/versionsA workflow's versions. Returns a plain JSON array.
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 |
workflow_id |
uuid | required | Workflow id |
Response
| Field | Type | Description |
|---|---|---|
id |
uuid | Version id |
workflow_id |
uuid | Workflow |
number |
integer | Version number |
status |
string | draft, test, live or archived |
yaml |
string | The YAML |
graph |
object | Nodes and edges, as in Validate YAML |
steps |
integer | Number of steps |
created_by, published_by |
object or null | {id, name} |
created_at, updated_at, published_at |
datetime or null | Timestamps |
change_summary |
string | What changed |
checklist |
object | The publish checklist that was ticked |
Errors
| Status | Code | When |
|---|---|---|
| 404 | workflow_not_found |
No such workflow |
curl "https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID/versions" \
-H "Authorization: Bearer sk_test_…"const res = await fetch("https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID/versions", {
headers: { Authorization: "Bearer sk_test_…" },
});
if (!res.ok) throw new Error((await res.json()).error.message);
const data = await res.json();import requests
resp = requests.get(
"https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID/versions",
headers={"Authorization": "Bearer sk_test_…"},
timeout=30,
)
resp.raise_for_status()
data = resp.json()[
{
"id": "0193a9e0-5d6e-7f7a-9b8c-0d1e2f3a4b5c",
"workflow_id": "0193a9e0-4c5d-7e6f-8a7b-9c0d1e2f3a4b",
"number": 4,
"status": "draft",
"yaml": "name: Crash to PR\non: issue.created\nsteps:\n - id: triage\n action: issue.triage\n …",
"graph": {
"nodes": [
{
"id": "trigger",
"kind": "trigger",
"label": "issue.created",
"action": null,
"line": 2,
"group": null
},
{
"id": "triage",
"kind": "action",
"label": "Triage",
"action": "issue.triage",
"line": 5,
"group": null
}
],
"edges": [
{
"from": "trigger",
"to": "triage",
"label": null
}
]
},
"steps": 6,
"created_by": {
"id": "0193a2c4-5e20-7c11-a3f0-6b9d2e4c8a15",
"name": "Priya Shah"
},
"created_at": "2026-11-01T16:40:00Z",
"updated_at": "2026-11-01T16:40:00Z",
"change_summary": "Ticket only for P0-P2",
"published_at": null,
"published_by": null,
"checklist": {}
}
]Create a draft#
/api/v1/orgs/{org_id}/workflows/{workflow_id}/versionsCreates a new draft version from YAML. Audit logged.
Auth: session only. Secret keys get 403 api_key_not_allowed. The role needs workflows.draft.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
org_id |
uuid | required | Organization id |
workflow_id |
uuid | required | Workflow id |
Body (JSON)
| Parameter | Type | Required | Description |
|---|---|---|---|
yaml |
string | required | 1 to 200,000 characters |
change_summary |
string | optional | Up to 2,000 characters |
Response
The version.
Errors
| Status | Code | When |
|---|---|---|
| 404 | workflow_not_found |
No such workflow |
| 422 | invalid_workflow |
The YAML doesn't compile; the message names the first error |
curl -X POST "https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID/versions" \
--cookie "ml_session=…" \
-H "Content-Type: application/json" \
-d '{
"yaml": "name: Crash to PR\non: issue.created\nsteps:\n - id: triage\n action: issue.triage\n …",
"change_summary": "Ticket only for P0-P2"
}'const res = await fetch("https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID/versions", {
method: "POST",
headers: { Cookie: "ml_session=…", "Content-Type": "application/json" },
body: JSON.stringify({
"yaml": "name: Crash to PR\non: issue.created\nsteps:\n - id: triage\n action: issue.triage\n …",
"change_summary": "Ticket only for P0-P2"
}),
});
if (!res.ok) throw new Error((await res.json()).error.message);
const data = await res.json();import requests
resp = requests.post(
"https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID/versions",
cookies={"ml_session": "…"},
json={
"yaml": "name: Crash to PR\non: issue.created\nsteps:\n - id: triage\n action: issue.triage\n …",
"change_summary": "Ticket only for P0-P2"
},
timeout=30,
)
resp.raise_for_status()
data = resp.json(){
"id": "0193a9e0-5d6e-7f7a-9b8c-0d1e2f3a4b5c",
"workflow_id": "0193a9e0-4c5d-7e6f-8a7b-9c0d1e2f3a4b",
"number": 4,
"status": "draft",
"yaml": "name: Crash to PR\non: issue.created\nsteps:\n - id: triage\n action: issue.triage\n …",
"graph": {
"nodes": [
{
"id": "trigger",
"kind": "trigger",
"label": "issue.created",
"action": null,
"line": 2,
"group": null
},
{
"id": "triage",
"kind": "action",
"label": "Triage",
"action": "issue.triage",
"line": 5,
"group": null
}
],
"edges": [
{
"from": "trigger",
"to": "triage",
"label": null
}
]
},
"steps": 6,
"created_by": {
"id": "0193a2c4-5e20-7c11-a3f0-6b9d2e4c8a15",
"name": "Priya Shah"
},
"created_at": "2026-11-01T16:40:00Z",
"updated_at": "2026-11-01T16:40:00Z",
"change_summary": "Ticket only for P0-P2",
"published_at": null,
"published_by": null,
"checklist": {}
}Get a version#
/api/v1/orgs/{org_id}/workflows/{workflow_id}/versions/{version_id}One version.
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 |
workflow_id |
uuid | required | Workflow id |
version_id |
uuid | required | Version id |
Response
The version.
Errors
| Status | Code | When |
|---|---|---|
| 404 | workflow_not_found |
No such workflow |
| 404 | workflow_version_not_found |
No such version |
curl "https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID/versions/VERSION_ID" \
-H "Authorization: Bearer sk_test_…"const res = await fetch("https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID/versions/VERSION_ID", {
headers: { Authorization: "Bearer sk_test_…" },
});
if (!res.ok) throw new Error((await res.json()).error.message);
const data = await res.json();import requests
resp = requests.get(
"https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID/versions/VERSION_ID",
headers={"Authorization": "Bearer sk_test_…"},
timeout=30,
)
resp.raise_for_status()
data = resp.json(){
"id": "0193a9e0-5d6e-7f7a-9b8c-0d1e2f3a4b5c",
"workflow_id": "0193a9e0-4c5d-7e6f-8a7b-9c0d1e2f3a4b",
"number": 4,
"status": "draft",
"yaml": "name: Crash to PR\non: issue.created\nsteps:\n - id: triage\n action: issue.triage\n …",
"graph": {
"nodes": [
{
"id": "trigger",
"kind": "trigger",
"label": "issue.created",
"action": null,
"line": 2,
"group": null
},
{
"id": "triage",
"kind": "action",
"label": "Triage",
"action": "issue.triage",
"line": 5,
"group": null
}
],
"edges": [
{
"from": "trigger",
"to": "triage",
"label": null
}
]
},
"steps": 6,
"created_by": {
"id": "0193a2c4-5e20-7c11-a3f0-6b9d2e4c8a15",
"name": "Priya Shah"
},
"created_at": "2026-11-01T16:40:00Z",
"updated_at": "2026-11-01T16:40:00Z",
"change_summary": "Ticket only for P0-P2",
"published_at": null,
"published_by": null,
"checklist": {}
}Update a draft#
/api/v1/orgs/{org_id}/workflows/{workflow_id}/versions/{version_id}Replaces a draft's YAML. Only drafts can be edited. Audit logged.
Auth: session only. Secret keys get 403 api_key_not_allowed. The role needs workflows.draft.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
org_id |
uuid | required | Organization id |
workflow_id |
uuid | required | Workflow id |
version_id |
uuid | required | Version id |
Body (JSON)
| Parameter | Type | Required | Description |
|---|---|---|---|
yaml |
string | required | 1 to 200,000 characters |
change_summary |
string | optional | Up to 2,000 characters |
Response
The version.
Errors
| Status | Code | When |
|---|---|---|
| 404 | workflow_not_found |
No such workflow |
| 404 | workflow_version_not_found |
No such version |
| 409 | version_not_draft |
The version isn't a draft |
| 422 | invalid_workflow |
The YAML doesn't compile |
curl -X PUT "https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID/versions/VERSION_ID" \
--cookie "ml_session=…" \
-H "Content-Type: application/json" \
-d '{
"yaml": "name: Crash to PR\non: issue.created\nsteps:\n - id: triage\n action: issue.triage\n …"
}'const res = await fetch("https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID/versions/VERSION_ID", {
method: "PUT",
headers: { Cookie: "ml_session=…", "Content-Type": "application/json" },
body: JSON.stringify({
"yaml": "name: Crash to PR\non: issue.created\nsteps:\n - id: triage\n action: issue.triage\n …"
}),
});
if (!res.ok) throw new Error((await res.json()).error.message);
const data = await res.json();import requests
resp = requests.put(
"https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID/versions/VERSION_ID",
cookies={"ml_session": "…"},
json={
"yaml": "name: Crash to PR\non: issue.created\nsteps:\n - id: triage\n action: issue.triage\n …"
},
timeout=30,
)
resp.raise_for_status()
data = resp.json(){
"id": "0193a9e0-5d6e-7f7a-9b8c-0d1e2f3a4b5c",
"workflow_id": "0193a9e0-4c5d-7e6f-8a7b-9c0d1e2f3a4b",
"number": 4,
"status": "draft",
"yaml": "name: Crash to PR\non: issue.created\nsteps:\n - id: triage\n action: issue.triage\n …",
"graph": {
"nodes": [
{
"id": "trigger",
"kind": "trigger",
"label": "issue.created",
"action": null,
"line": 2,
"group": null
},
{
"id": "triage",
"kind": "action",
"label": "Triage",
"action": "issue.triage",
"line": 5,
"group": null
}
],
"edges": [
{
"from": "trigger",
"to": "triage",
"label": null
}
]
},
"steps": 6,
"created_by": {
"id": "0193a2c4-5e20-7c11-a3f0-6b9d2e4c8a15",
"name": "Priya Shah"
},
"created_at": "2026-11-01T16:40:00Z",
"updated_at": "2026-11-01T16:40:00Z",
"change_summary": "Ticket only for P0-P2",
"published_at": null,
"published_by": null,
"checklist": {}
}Make a draft the test version#
/api/v1/orgs/{org_id}/workflows/{workflow_id}/versions/{version_id}/testMakes a draft the version that test mode runs.
Auth: session only. Secret keys get 403 api_key_not_allowed. The role needs workflows.draft.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
org_id |
uuid | required | Organization id |
workflow_id |
uuid | required | Workflow id |
version_id |
uuid | required | Version id |
Response
The version, with status: test.
Errors
| Status | Code | When |
|---|---|---|
| 404 | workflow_not_found |
No such workflow |
| 404 | workflow_version_not_found |
No such version |
| 409 | version_not_draft |
The version isn't a draft |
curl -X POST "https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID/versions/VERSION_ID/test" \
--cookie "ml_session=…"const res = await fetch("https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID/versions/VERSION_ID/test", {
method: "POST",
headers: { Cookie: "ml_session=…" },
});
if (!res.ok) throw new Error((await res.json()).error.message);
const data = await res.json();import requests
resp = requests.post(
"https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID/versions/VERSION_ID/test",
cookies={"ml_session": "…"},
timeout=30,
)
resp.raise_for_status()
data = resp.json(){
"id": "0193a9e0-5d6e-7f7a-9b8c-0d1e2f3a4b5c",
"workflow_id": "0193a9e0-4c5d-7e6f-8a7b-9c0d1e2f3a4b",
"number": 4,
"status": "test",
"yaml": "name: Crash to PR\non: issue.created\nsteps:\n - id: triage\n action: issue.triage\n …",
"graph": {
"nodes": [
{
"id": "trigger",
"kind": "trigger",
"label": "issue.created",
"action": null,
"line": 2,
"group": null
},
{
"id": "triage",
"kind": "action",
"label": "Triage",
"action": "issue.triage",
"line": 5,
"group": null
}
],
"edges": [
{
"from": "trigger",
"to": "triage",
"label": null
}
]
},
"steps": 6,
"created_by": {
"id": "0193a2c4-5e20-7c11-a3f0-6b9d2e4c8a15",
"name": "Priya Shah"
},
"created_at": "2026-11-01T16:40:00Z",
"updated_at": "2026-11-01T16:40:00Z",
"change_summary": "Ticket only for P0-P2",
"published_at": null,
"published_by": null,
"checklist": {}
}Publish a version#
/api/v1/orgs/{org_id}/workflows/{workflow_id}/versions/{version_id}/publishMakes a draft or test version live. The previous live version is archived. Publishing needs permission for every action the workflow uses. Audit logged.
Auth: session only. Secret keys get 403 api_key_not_allowed. The role needs workflows.publish.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
org_id |
uuid | required | Organization id |
workflow_id |
uuid | required | Workflow id |
version_id |
uuid | required | Version id |
Body (JSON)
| Parameter | Type | Required | Description |
|---|---|---|---|
checklist |
object | optional | The publish checklist you ticked |
Response
The version, with status: live.
Errors
| Status | Code | When |
|---|---|---|
| 404 | workflow_not_found |
No such workflow |
| 404 | workflow_version_not_found |
No such version |
| 409 | version_not_publishable |
The version is live or archived |
| 403 | action_not_allowed |
An action in it needs a permission you don't have |
curl -X POST "https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID/versions/VERSION_ID/publish" \
--cookie "ml_session=…" \
-H "Content-Type: application/json" \
-d '{
"checklist": {
"dry_run_passed": true,
"owners_notified": true
}
}'const res = await fetch("https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID/versions/VERSION_ID/publish", {
method: "POST",
headers: { Cookie: "ml_session=…", "Content-Type": "application/json" },
body: JSON.stringify({
"checklist": {
"dry_run_passed": true,
"owners_notified": true
}
}),
});
if (!res.ok) throw new Error((await res.json()).error.message);
const data = await res.json();import requests
resp = requests.post(
"https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID/versions/VERSION_ID/publish",
cookies={"ml_session": "…"},
json={
"checklist": {
"dry_run_passed": True,
"owners_notified": True
}
},
timeout=30,
)
resp.raise_for_status()
data = resp.json(){
"id": "0193a9e0-5d6e-7f7a-9b8c-0d1e2f3a4b5c",
"workflow_id": "0193a9e0-4c5d-7e6f-8a7b-9c0d1e2f3a4b",
"number": 4,
"status": "live",
"yaml": "name: Crash to PR\non: issue.created\nsteps:\n - id: triage\n action: issue.triage\n …",
"graph": {
"nodes": [
{
"id": "trigger",
"kind": "trigger",
"label": "issue.created",
"action": null,
"line": 2,
"group": null
},
{
"id": "triage",
"kind": "action",
"label": "Triage",
"action": "issue.triage",
"line": 5,
"group": null
}
],
"edges": [
{
"from": "trigger",
"to": "triage",
"label": null
}
]
},
"steps": 6,
"created_by": {
"id": "0193a2c4-5e20-7c11-a3f0-6b9d2e4c8a15",
"name": "Priya Shah"
},
"created_at": "2026-11-01T16:40:00Z",
"updated_at": "2026-11-01T16:40:00Z",
"change_summary": "Ticket only for P0-P2",
"published_at": "2026-11-05T10:05:00Z",
"published_by": {
"id": "0193a2c4-5e20-7c11-a3f0-6b9d2e4c8a15",
"name": "Priya Shah"
},
"checklist": {
"dry_run_passed": true,
"owners_notified": true
}
}Roll back to a version#
/api/v1/orgs/{org_id}/workflows/{workflow_id}/versions/{version_id}/rollbackMakes an archived version live again. Audit logged.
Auth: session only. Secret keys get 403 api_key_not_allowed. The role needs workflows.publish.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
org_id |
uuid | required | Organization id |
workflow_id |
uuid | required | Workflow id |
version_id |
uuid | required | Version id |
Response
The version, with status: live.
Errors
| Status | Code | When |
|---|---|---|
| 404 | workflow_not_found |
No such workflow |
| 404 | workflow_version_not_found |
No such version |
| 409 | version_not_archived |
Only archived versions can be rolled back to |
curl -X POST "https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID/versions/VERSION_ID/rollback" \
--cookie "ml_session=…"const res = await fetch("https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID/versions/VERSION_ID/rollback", {
method: "POST",
headers: { Cookie: "ml_session=…" },
});
if (!res.ok) throw new Error((await res.json()).error.message);
const data = await res.json();import requests
resp = requests.post(
"https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID/versions/VERSION_ID/rollback",
cookies={"ml_session": "…"},
timeout=30,
)
resp.raise_for_status()
data = resp.json(){
"id": "0193a9e0-5d6e-7f7a-9b8c-0d1e2f3a4b5c",
"workflow_id": "0193a9e0-4c5d-7e6f-8a7b-9c0d1e2f3a4b",
"number": 2,
"status": "live",
"yaml": "name: Crash to PR\non: issue.created\nsteps:\n - id: triage\n action: issue.triage\n …",
"graph": {
"nodes": [
{
"id": "trigger",
"kind": "trigger",
"label": "issue.created",
"action": null,
"line": 2,
"group": null
},
{
"id": "triage",
"kind": "action",
"label": "Triage",
"action": "issue.triage",
"line": 5,
"group": null
}
],
"edges": [
{
"from": "trigger",
"to": "triage",
"label": null
}
]
},
"steps": 6,
"created_by": {
"id": "0193a2c4-5e20-7c11-a3f0-6b9d2e4c8a15",
"name": "Priya Shah"
},
"created_at": "2026-11-01T16:40:00Z",
"updated_at": "2026-11-01T16:40:00Z",
"change_summary": "Ticket only for P0-P2",
"published_at": null,
"published_by": null,
"checklist": {}
}Dry-run a version#
/api/v1/orgs/{org_id}/workflows/{workflow_id}/versions/{version_id}/dry-runReplays an issue through a version. Reads are real; every write is simulated. Returns the run id; follow it with Get a run.
Auth: session only. Secret keys get 403 api_key_not_allowed. The role needs workflows.draft.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
org_id |
uuid | required | Organization id |
workflow_id |
uuid | required | Workflow id |
version_id |
uuid | required | Version id |
Body (JSON)
| Parameter | Type | Required | Description |
|---|---|---|---|
issue_id |
uuid | required | The issue to replay |
simulate_approval |
boolean | optional | Approve gates automatically so later steps run. Default false. |
Response
| Field | Type | Description |
|---|---|---|
run_id |
uuid | The dry run |
Errors
| Status | Code | When |
|---|---|---|
| 404 | workflow_not_found |
No such workflow |
| 404 | workflow_version_not_found |
No such version |
| 404 | issue_not_found |
No such issue |
curl -X POST "https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID/versions/VERSION_ID/dry-run" \
--cookie "ml_session=…" \
-H "Content-Type: application/json" \
-d '{
"issue_id": "0193b7e2-0a4c-7f19-b8d2-51c3e9a7f604",
"simulate_approval": true
}'const res = await fetch("https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID/versions/VERSION_ID/dry-run", {
method: "POST",
headers: { Cookie: "ml_session=…", "Content-Type": "application/json" },
body: JSON.stringify({
"issue_id": "0193b7e2-0a4c-7f19-b8d2-51c3e9a7f604",
"simulate_approval": true
}),
});
if (!res.ok) throw new Error((await res.json()).error.message);
const data = await res.json();import requests
resp = requests.post(
"https://app.getmendloop.com/api/v1/orgs/ORG_ID/workflows/WORKFLOW_ID/versions/VERSION_ID/dry-run",
cookies={"ml_session": "…"},
json={
"issue_id": "0193b7e2-0a4c-7f19-b8d2-51c3e9a7f604",
"simulate_approval": True
},
timeout=30,
)
resp.raise_for_status()
data = resp.json(){
"run_id": "0193c5a0-1a2b-7c3d-8e4f-5a6b7c8d9e0f"
}Runs#
List runs#
/api/v1/orgs/{org_id}/runsWorkflow runs, newest first.
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 |
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workflow_id |
uuid | optional | Only this workflow |
issue_id |
uuid | optional | Only this issue |
state |
string | optional | queued, running, waiting, succeeded, failed, cancelled (comma-separated) |
mode |
string | optional | live or test. Default: the request's mode. |
limit |
integer | optional | 1 to 200, default 50 |
cursor |
string | optional | next_cursor from the previous page |
Response
| Field | Type | Description |
|---|---|---|
items[].id |
uuid | Run id |
items[].workflow_id, workflow_name |
uuid, string | Workflow |
items[].version_id, version_number |
uuid, integer | Version that ran |
items[].issue_id, issue_title |
uuid, string or null | The issue |
items[].state |
string | queued, running, waiting, succeeded, failed or cancelled |
items[].waiting_on |
object or null | {kind: approval|event|delay, detail, until} |
items[].started_at, ended_at, created_at |
datetime or null | Timestamps |
items[].cost_usd, tokens |
number, integer | Model usage |
items[].dry_run |
boolean | Started as a dry run |
items[].simulated |
boolean | Writes were simulated |
items[].mode |
string | live or test |
items[].trigger_event |
string | e.g. issue.created |
items[].error |
string or null | Why it failed |
Errors
| Status | Code | When |
|---|---|---|
| 422 | invalid_state |
Unknown state value |
curl "https://app.getmendloop.com/api/v1/orgs/ORG_ID/runs?state=waiting,running" \
-H "Authorization: Bearer sk_test_…"const res = await fetch("https://app.getmendloop.com/api/v1/orgs/ORG_ID/runs?state=waiting,running", {
headers: { Authorization: "Bearer sk_test_…" },
});
if (!res.ok) throw new Error((await res.json()).error.message);
const data = await res.json();import requests
resp = requests.get(
"https://app.getmendloop.com/api/v1/orgs/ORG_ID/runs",
headers={"Authorization": "Bearer sk_test_…"},
params={
"state": "waiting,running"
},
timeout=30,
)
resp.raise_for_status()
data = resp.json(){
"items": [
{
"id": "0193c5a0-1a2b-7c3d-8e4f-5a6b7c8d9e0f",
"workflow_id": "0193a9e0-4c5d-7e6f-8a7b-9c0d1e2f3a4b",
"workflow_name": "Crash to PR",
"version_id": "0193a9e0-5d6e-7f7a-9b8c-0d1e2f3a4b5c",
"version_number": 3,
"issue_id": "0193b7e2-0a4c-7f19-b8d2-51c3e9a7f604",
"issue_title": "TypeError: Cannot read properties of undefined (reading 'id')",
"state": "waiting",
"waiting_on": {
"kind": "approval",
"detail": "Waiting for Priya Shah",
"until": "2026-11-12T09:16:20Z"
},
"started_at": "2026-11-05T09:15:00Z",
"ended_at": null,
"created_at": "2026-11-05T09:15:00Z",
"cost_usd": 0.09,
"tokens": 43800,
"dry_run": false,
"simulated": false,
"mode": "live",
"trigger_event": "issue.created",
"error": null
}
],
"next_cursor": null
}Get a run#
/api/v1/orgs/{org_id}/runs/{run_id}One run with its steps.
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 |
run_id |
uuid | required | Run id |
Response
| Field | Type | Description |
|---|---|---|
… |
Every field of a run in the list | |
steps |
object[] | {id, step_id, name, kind, action, status, started_at, ended_at, attempts, tier, model, tokens_in, tokens_out, cost_usd, idempotency_key, error, parallel_group, simulated}; status is pending, running, succeeded, failed, skipped, waiting or simulated |
Errors
| Status | Code | When |
|---|---|---|
| 404 | run_not_found |
No such run in this mode, or its issue is in a project you can't see |
curl "https://app.getmendloop.com/api/v1/orgs/ORG_ID/runs/RUN_ID" \
-H "Authorization: Bearer sk_test_…"const res = await fetch("https://app.getmendloop.com/api/v1/orgs/ORG_ID/runs/RUN_ID", {
headers: { Authorization: "Bearer sk_test_…" },
});
if (!res.ok) throw new Error((await res.json()).error.message);
const data = await res.json();import requests
resp = requests.get(
"https://app.getmendloop.com/api/v1/orgs/ORG_ID/runs/RUN_ID",
headers={"Authorization": "Bearer sk_test_…"},
timeout=30,
)
resp.raise_for_status()
data = resp.json(){
"id": "0193c5a0-1a2b-7c3d-8e4f-5a6b7c8d9e0f",
"workflow_id": "0193a9e0-4c5d-7e6f-8a7b-9c0d1e2f3a4b",
"workflow_name": "Crash to PR",
"version_id": "0193a9e0-5d6e-7f7a-9b8c-0d1e2f3a4b5c",
"version_number": 3,
"issue_id": "0193b7e2-0a4c-7f19-b8d2-51c3e9a7f604",
"issue_title": "TypeError: Cannot read properties of undefined (reading 'id')",
"state": "waiting",
"waiting_on": {
"kind": "approval",
"detail": "Waiting for Priya Shah",
"until": "2026-11-12T09:16:20Z"
},
"started_at": "2026-11-05T09:15:00Z",
"ended_at": null,
"created_at": "2026-11-05T09:15:00Z",
"cost_usd": 0.09,
"tokens": 43800,
"dry_run": false,
"simulated": false,
"mode": "live",
"trigger_event": "issue.created",
"error": null,
"steps": [
{
"id": "0193c5a0-2b3c-7d4e-9f5a-6b7c8d9e0f1a",
"step_id": "triage",
"name": "Triage",
"kind": "action",
"action": "issue.triage",
"status": "succeeded",
"started_at": "2026-11-05T09:15:00Z",
"ended_at": "2026-11-05T09:15:01Z",
"attempts": 1,
"tier": null,
"model": null,
"tokens_in": 0,
"tokens_out": 0,
"cost_usd": 0.0,
"idempotency_key": "0193c5a0-1a2b-7c3d-8e4f-5a6b7c8d9e0f:triage:1",
"error": null,
"parallel_group": null,
"simulated": false
}
]
}Get a step#
/api/v1/orgs/{org_id}/runs/{run_id}/steps/{step_run_id}A step's input, output, tool calls and logs. Secrets are masked.
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 |
run_id |
uuid | required | Run id |
step_run_id |
uuid | required | The step's id from Get a run |
Response
| Field | Type | Description |
|---|---|---|
id |
uuid | Step id |
step_id |
string | Step id in the YAML |
input |
any | What the step received |
output |
any | What it returned; simulated writes include what would have been sent |
tool_calls |
object[] | {name, args, result_summary, ms} |
logs |
object[] | {at, level, message, data} |
Errors
| Status | Code | When |
|---|---|---|
| 404 | run_not_found |
No such run in this mode, or its issue is in a project you can't see |
| 404 | step_not_found |
No such step |
curl "https://app.getmendloop.com/api/v1/orgs/ORG_ID/runs/RUN_ID/steps/STEP_RUN_ID" \
-H "Authorization: Bearer sk_test_…"const res = await fetch("https://app.getmendloop.com/api/v1/orgs/ORG_ID/runs/RUN_ID/steps/STEP_RUN_ID", {
headers: { Authorization: "Bearer sk_test_…" },
});
if (!res.ok) throw new Error((await res.json()).error.message);
const data = await res.json();import requests
resp = requests.get(
"https://app.getmendloop.com/api/v1/orgs/ORG_ID/runs/RUN_ID/steps/STEP_RUN_ID",
headers={"Authorization": "Bearer sk_test_…"},
timeout=30,
)
resp.raise_for_status()
data = resp.json(){
"id": "0193c5a0-2b3c-7d4e-9f5a-6b7c8d9e0f1a",
"step_id": "triage",
"input": {
"issue_id": "0193b7e2-0a4c-7f19-b8d2-51c3e9a7f604"
},
"output": {
"severity": "P2",
"score": 47
},
"tool_calls": [],
"logs": [
{
"at": "2026-11-05T09:15:00Z",
"level": "info",
"message": "Scored P2 (47)",
"data": null
}
]
}Cancel a run#
/api/v1/orgs/{org_id}/runs/{run_id}/cancelCancels a run that hasn't finished. Audit logged.
Auth: session only. Secret keys get 403 api_key_not_allowed. The role needs workflows.draft.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
org_id |
uuid | required | Organization id |
run_id |
uuid | required | Run id |
Response
The run with its steps, state: cancelled.
Errors
| Status | Code | When |
|---|---|---|
| 404 | run_not_found |
No such run in this mode, or its issue is in a project you can't see |
| 409 | run_finished |
The run already finished |
curl -X POST "https://app.getmendloop.com/api/v1/orgs/ORG_ID/runs/RUN_ID/cancel" \
--cookie "ml_session=…"const res = await fetch("https://app.getmendloop.com/api/v1/orgs/ORG_ID/runs/RUN_ID/cancel", {
method: "POST",
headers: { Cookie: "ml_session=…" },
});
if (!res.ok) throw new Error((await res.json()).error.message);
const data = await res.json();import requests
resp = requests.post(
"https://app.getmendloop.com/api/v1/orgs/ORG_ID/runs/RUN_ID/cancel",
cookies={"ml_session": "…"},
timeout=30,
)
resp.raise_for_status()
data = resp.json(){
"id": "0193c5a0-1a2b-7c3d-8e4f-5a6b7c8d9e0f",
"workflow_id": "0193a9e0-4c5d-7e6f-8a7b-9c0d1e2f3a4b",
"workflow_name": "Crash to PR",
"version_id": "0193a9e0-5d6e-7f7a-9b8c-0d1e2f3a4b5c",
"version_number": 3,
"issue_id": "0193b7e2-0a4c-7f19-b8d2-51c3e9a7f604",
"issue_title": "TypeError: Cannot read properties of undefined (reading 'id')",
"state": "cancelled",
"waiting_on": null,
"started_at": "2026-11-05T09:15:00Z",
"ended_at": "2026-11-05T10:10:00Z",
"created_at": "2026-11-05T09:15:00Z",
"cost_usd": 0.09,
"tokens": 43800,
"dry_run": false,
"simulated": false,
"mode": "live",
"trigger_event": "issue.created",
"error": null,
"steps": [
{
"id": "0193c5a0-2b3c-7d4e-9f5a-6b7c8d9e0f1a",
"step_id": "triage",
"name": "Triage",
"kind": "action",
"action": "issue.triage",
"status": "succeeded",
"started_at": "2026-11-05T09:15:00Z",
"ended_at": "2026-11-05T09:15:01Z",
"attempts": 1,
"tier": null,
"model": null,
"tokens_in": 0,
"tokens_out": 0,
"cost_usd": 0.0,
"idempotency_key": "0193c5a0-1a2b-7c3d-8e4f-5a6b7c8d9e0f:triage:1",
"error": null,
"parallel_group": null,
"simulated": false
}
]
}Retry a step#
/api/v1/orgs/{org_id}/runs/{run_id}/steps/{step_run_id}/retryRuns a failed step again as a new attempt; the run resumes from it and earlier steps are kept. Audit logged.
Auth: session only. Secret keys get 403 api_key_not_allowed. The role needs workflows.draft.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
org_id |
uuid | required | Organization id |
run_id |
uuid | required | Run id |
step_run_id |
uuid | required | The failed step's id |
Response
The run with its steps.
Errors
| Status | Code | When |
|---|---|---|
| 404 | run_not_found |
No such run in this mode, or its issue is in a project you can't see |
| 404 | step_not_found |
No such step |
| 409 | step_not_failed |
The step isn't failed |
| 409 | run_not_retryable |
The run was cancelled or succeeded; start a new run instead |
curl -X POST "https://app.getmendloop.com/api/v1/orgs/ORG_ID/runs/RUN_ID/steps/STEP_RUN_ID/retry" \
--cookie "ml_session=…"const res = await fetch("https://app.getmendloop.com/api/v1/orgs/ORG_ID/runs/RUN_ID/steps/STEP_RUN_ID/retry", {
method: "POST",
headers: { Cookie: "ml_session=…" },
});
if (!res.ok) throw new Error((await res.json()).error.message);
const data = await res.json();import requests
resp = requests.post(
"https://app.getmendloop.com/api/v1/orgs/ORG_ID/runs/RUN_ID/steps/STEP_RUN_ID/retry",
cookies={"ml_session": "…"},
timeout=30,
)
resp.raise_for_status()
data = resp.json(){
"id": "0193c5a0-1a2b-7c3d-8e4f-5a6b7c8d9e0f",
"workflow_id": "0193a9e0-4c5d-7e6f-8a7b-9c0d1e2f3a4b",
"workflow_name": "Crash to PR",
"version_id": "0193a9e0-5d6e-7f7a-9b8c-0d1e2f3a4b5c",
"version_number": 3,
"issue_id": "0193b7e2-0a4c-7f19-b8d2-51c3e9a7f604",
"issue_title": "TypeError: Cannot read properties of undefined (reading 'id')",
"state": "queued",
"waiting_on": null,
"started_at": "2026-11-05T09:15:00Z",
"ended_at": null,
"created_at": "2026-11-05T09:15:00Z",
"cost_usd": 0.09,
"tokens": 43800,
"dry_run": false,
"simulated": false,
"mode": "live",
"trigger_event": "issue.created",
"error": null,
"steps": [
{
"id": "0193c5a0-2b3c-7d4e-9f5a-6b7c8d9e0f1a",
"step_id": "triage",
"name": "Triage",
"kind": "action",
"action": "issue.triage",
"status": "succeeded",
"started_at": "2026-11-05T09:15:00Z",
"ended_at": "2026-11-05T09:15:01Z",
"attempts": 1,
"tier": null,
"model": null,
"tokens_in": 0,
"tokens_out": 0,
"cost_usd": 0.0,
"idempotency_key": "0193c5a0-1a2b-7c3d-8e4f-5a6b7c8d9e0f:triage:1",
"error": null,
"parallel_group": null,
"simulated": false
}
]
}