> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.middesk.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.middesk.com/_mcp/server.

# Resume an interrupted agent run

POST https://api.middesk.com/v1/runs/{id}/resume
Content-Type: application/json

Resumes a run whose `status` is `interrupted` by recording the reviewer's decisions on the artifacts its pending interrupts proposed. The decisions are stored as an agent application and the run continues with `status: running`. Generate a new `agent_application.id` per review; retrying with the same `id` and decisions is a no-op.

Reference: https://docs.middesk.com/api-reference/agents/runs/resume-agent-run

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `id` (string, required) — Agent run ID

### Body (application/json)

This endpoint expects an object.

- `agent_application` (AgentsRunResumeRequestParamAgentApplication, required) — The reviewer's decisions, grouped under one caller-supplied application ID. Every decision must reference an interrupt that is currently pending on the run (see the run's `interrupts` array).

## Response

### 200

agent run resumed

- `object` (string, required) — Object type identifier.
- `id` (string, required) — Unique identifier for the agent run.
- `created_at` (datetime, required) — Timestamp when the agent run record was created.
- `updated_at` (datetime, required) — Timestamp when the agent run record was last updated.
- `status` (enum, required) — Current lifecycle status of the agent run.
  - Allowed values: `running`, `completed`, `error`, `interrupted`
- `thread_id` (string, optional) — Identifier of the agent thread this run belongs to.
- `business_id` (string, optional, nullable) — Middesk business the run is scoped to. Null when the run was started with an inline `business` payload whose business did not exist yet.
- `agent` (string, optional) — Agent type that produced this run (for example, `cip_orchestrator`).
- `requester` (AgentsRunRequester, optional, nullable) — Principal that initiated the run. Populated with the authenticated user's identity when a session caller initiates the run, and with the account when an API key caller initiates the run. `null` for system-initiated runs.
- `started_at` (datetime, optional, nullable) — Timestamp when the agent run started.
- `ended_at` (datetime, optional, nullable) — Timestamp when the agent run finished.
- `output` (AgentsRunOutput, optional, nullable) — Artifact envelope produced by the agent. Non-null only when `status` is `completed`; `null` for `running`, `interrupted`, and `error` runs.
- `interrupts` (list of AgentsRunInterruptsItem, optional) — Pending interrupt requests awaiting input. Empty when the run is not interrupted. An interrupt that proposes artifacts for review is resumed by calling `POST /v1/runs/{id}/resume` with an `agent_application` whose `decisions` reference the interrupt's `id` and decide every artifact it proposed. An interrupt that requests other input, such as a document upload, proposes no artifacts and is not resumed with decisions.
- `steps` (list of AgentsStep, optional) — Top-level execution steps for this run. Opt-in: pass `?include=steps` on `GET /v1/runs/{id}` to populate this field. Omitted by default.

## Errors

### 400 Resume Agent Run Request Bad Request Error

invalid agent_application

- `errors` (list of ErrorResponseErrorsItem, required)

### 404 Resume Agent Run Request Not Found Error

agent run not found

- `errors` (list of ErrorResponseErrorsItem, required)

### 409 Resume Agent Run Request Conflict Error

agent run is not interrupted

- `errors` (list of ErrorResponseErrorsItem, required)

## Types

### AgentsRunResumeRequestParamAgentApplication

The reviewer's decisions, grouped under one caller-supplied application ID. Every decision must reference an interrupt that is currently pending on the run (see the run's `interrupts` array).

- `id` (string, required) — Caller-generated identifier for this application. It makes the request idempotent: retrying with the same `id` and the same decisions after a successful resume is a no-op, while reusing an `id` with different decisions is rejected with `409`.
- `decisions` (list of AgentsRunResumeRequestParamAgentApplicationDecisionsItem, required) — One decision per artifact. Decisions must cover every reviewable artifact proposed by the referenced interrupts, and each `artifact_id` may appear only once.

### AgentsRunRequester

Principal that initiated the run. Populated with the authenticated user's identity when a session caller initiates the run, and with the account when an API key caller initiates the run. `null` for system-initiated runs.

- `id` (string, required) — Identifier of the requesting user or account.
- `name` (string, required) — Display name of the requester.
- `email` (string, optional, nullable) — Email address of the requester. Populated for user requesters and `null` for account requesters.

### AgentsRunOutput

Artifact envelope produced by the agent. Non-null only when `status` is `completed`; `null` for `running`, `interrupted`, and `error` runs.

- `artifacts` (list of AgentsArtifact, required) — Artifacts produced by the agent during this run.

### AgentsRunInterruptsItem

- `id` (string, required) — Identifier of the interrupt request.
- `value` (map from string to any, required) — Agent-defined interrupt payload. Shape varies by agent, but typically carries `agent` (the sub-agent that raised the interrupt), `label` (human-readable prompt), and `artifacts` (proposed changes awaiting review). The orchestrator agent (`cip_orchestrator`) wraps sub-agent interrupts under a `proposals` array with `type: combined_proposal`.
- `agent` (string, optional, nullable) — Agent type that raised the interrupt. Lifted from `value.agent` and surfaced at the top level for convenience; omitted when the interrupt did not declare an agent.

### AgentsStep

A step in an agent workflow execution timeline.

- `id` (string, required) — Unique identifier for the step.
- `run_id` (string, required) — Identifier of the agent run that produced the step.
- `type` (enum, required) — Category of step output.
  - Allowed values: `activity`, `output`, `interrupt`, `error`
- `name` (string, required) — Internal step name.
- `label` (string, required) — Human-readable step label.
- `status` (enum, required) — Current execution status for the step.
  - Allowed values: `running`, `completed`, `error`
- `started_at` (datetime, required) — Timestamp when the step started.
- `agent` (string, optional) — Agent identifier that generated this step.
- `parent_step_id` (string, optional, nullable) — Parent step identifier for nested steps.
- `completed_at` (datetime, optional, nullable) — Timestamp when the step completed.
- `steps` (list of AgentsStep, optional) — Nested child steps.
- `result` (AgentsStepResult, optional) — Structured result payload for the step.
- `artifacts` (list of AgentsArtifact, optional) — Artifacts produced by the step.

### ErrorResponseErrorsItem

- `message` (string, required)
- `parameter` (string, optional) — Request parameter associated with the error, when applicable

### AgentsRunResumeRequestParamAgentApplicationDecisionsItem

- `interrupt_id` (string, required) — Identifier of the pending interrupt that proposed the artifact, taken from the run's `interrupts[].id`.
- `artifact_id` (string, required) — Identifier of the proposed artifact being decided.
- `outcome` (enum, required) — How the reviewer resolved the artifact. `accepted` applies the agent's proposal as-is, `corrected` applies the value given in `correction`, `excluded` rejects the artifact so it is not applied, and `skipped` leaves the artifact undecided.
  - Allowed values: `accepted`, `corrected`, `excluded`, `skipped`
- `selected_source_ids` (list of string, required) — Identifiers of the artifact's sources the reviewer relied on, taken from the artifact's `sources[].id`. Pass an empty array for `excluded` and `skipped` decisions.
- `correction` (AgentsRunResumeRequestParamAgentApplicationDecisionsItemCorrection, optional) — The reviewer's replacement value and rationale. Required when `outcome` is `corrected` and not allowed otherwise.

### AgentsArtifact

A structured artifact produced by an agent step.

- `title` (string, required) — Human-readable title for the artifact.
- `type` (string, required) — Artifact type identifier.
- `confidence` (string, optional, nullable) — Optional confidence label for artifact quality.
- `summary` (string, optional, nullable) — Optional summary of the artifact contents.
- `sources` (list of AgentsSource, optional) — Source references used to produce the artifact.

### AgentsStepResult

Structured result payload for the step.

- `resolution` (enum, optional) — How the interrupt was resolved. Present only on completed interrupt steps when an interrupt policy auto-approved or skipped the interrupt. Absent for manual resolutions.
  - Allowed values: `auto_approve`, `skip`

### AgentsRunResumeRequestParamAgentApplicationDecisionsItemCorrection

The reviewer's replacement value and rationale. Required when `outcome` is `corrected` and not allowed otherwise.

- `resolved_value` (string, required) — Value to apply in place of the agent's proposal.
- `reason` (string, required) — Why the reviewer overrode the agent's proposal.

### AgentsSource

A source reference used by an agent artifact.

- `url` (string, required) — Canonical source URL.
- `source_name` (string, optional) — Human-readable source name.
- `source_tier` (string, optional) — Source quality or trust tier.
- `source_type` (string, optional) — Source category.

## Examples

**Request**

```json
{
  "agent_application": {
    "id": "7f3a9c1e-5b2d-4e8f-9a6c-1d2e3f4a5b6c",
    "decisions": [
      {
        "interrupt_id": "4b08f4dc71e30164e7b49fd74ee911f4",
        "artifact_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
        "outcome": "accepted",
        "selected_source_ids": [
          "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e"
        ]
      }
    ]
  }
}
```

**Response**

```json
{
  "object": "run",
  "id": "id",
  "created_at": "2024-01-15T09:30:00Z",
  "updated_at": "2024-01-15T09:30:00Z",
  "status": "running",
  "thread_id": "thread_id",
  "business_id": "business_id",
  "agent": "agent",
  "requester": {
    "id": "id",
    "name": "name",
    "email": "email"
  },
  "started_at": "2024-01-15T09:30:00Z",
  "ended_at": "2024-01-15T09:30:00Z",
  "output": {
    "artifacts": [
      {
        "title": "title",
        "type": "type"
      }
    ]
  },
  "interrupts": [
    {
      "id": "id",
      "value": {
        "key": "value"
      },
      "agent": "agent"
    }
  ],
  "steps": [
    {
      "id": "id",
      "run_id": "run_id",
      "type": "activity",
      "name": "name",
      "label": "label",
      "status": "running",
      "started_at": "2024-01-15T09:30:00Z",
      "agent": "agent",
      "parent_step_id": "parent_step_id",
      "completed_at": "2024-01-15T09:30:00Z",
      "artifacts": [
        {
          "title": "title",
          "type": "type"
        }
      ]
    }
  ]
}
```

**SDK Code**

```python Accept Proposed Artifact
import requests

url = "https://api.middesk.com/v1/runs/id/resume"

payload = { "agent_application": {
        "id": "7f3a9c1e-5b2d-4e8f-9a6c-1d2e3f4a5b6c",
        "decisions": [
            {
                "interrupt_id": "4b08f4dc71e30164e7b49fd74ee911f4",
                "artifact_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                "outcome": "accepted",
                "selected_source_ids": ["b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e"]
            }
        ]
    } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Accept Proposed Artifact
const url = 'https://api.middesk.com/v1/runs/id/resume';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"agent_application":{"id":"7f3a9c1e-5b2d-4e8f-9a6c-1d2e3f4a5b6c","decisions":[{"interrupt_id":"4b08f4dc71e30164e7b49fd74ee911f4","artifact_id":"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d","outcome":"accepted","selected_source_ids":["b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e"]}]}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Accept Proposed Artifact
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.middesk.com/v1/runs/id/resume"

	payload := strings.NewReader("{\n  \"agent_application\": {\n    \"id\": \"7f3a9c1e-5b2d-4e8f-9a6c-1d2e3f4a5b6c\",\n    \"decisions\": [\n      {\n        \"interrupt_id\": \"4b08f4dc71e30164e7b49fd74ee911f4\",\n        \"artifact_id\": \"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d\",\n        \"outcome\": \"accepted\",\n        \"selected_source_ids\": [\n          \"b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e\"\n        ]\n      }\n    ]\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Accept Proposed Artifact
require 'uri'
require 'net/http'

url = URI("https://api.middesk.com/v1/runs/id/resume")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"agent_application\": {\n    \"id\": \"7f3a9c1e-5b2d-4e8f-9a6c-1d2e3f4a5b6c\",\n    \"decisions\": [\n      {\n        \"interrupt_id\": \"4b08f4dc71e30164e7b49fd74ee911f4\",\n        \"artifact_id\": \"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d\",\n        \"outcome\": \"accepted\",\n        \"selected_source_ids\": [\n          \"b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e\"\n        ]\n      }\n    ]\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Accept Proposed Artifact
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.middesk.com/v1/runs/id/resume")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"agent_application\": {\n    \"id\": \"7f3a9c1e-5b2d-4e8f-9a6c-1d2e3f4a5b6c\",\n    \"decisions\": [\n      {\n        \"interrupt_id\": \"4b08f4dc71e30164e7b49fd74ee911f4\",\n        \"artifact_id\": \"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d\",\n        \"outcome\": \"accepted\",\n        \"selected_source_ids\": [\n          \"b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e\"\n        ]\n      }\n    ]\n  }\n}")
  .asString();
```

```php Accept Proposed Artifact
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.middesk.com/v1/runs/id/resume', [
  'body' => '{
  "agent_application": {
    "id": "7f3a9c1e-5b2d-4e8f-9a6c-1d2e3f4a5b6c",
    "decisions": [
      {
        "interrupt_id": "4b08f4dc71e30164e7b49fd74ee911f4",
        "artifact_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
        "outcome": "accepted",
        "selected_source_ids": [
          "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e"
        ]
      }
    ]
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Accept Proposed Artifact
using RestSharp;

var client = new RestClient("https://api.middesk.com/v1/runs/id/resume");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"agent_application\": {\n    \"id\": \"7f3a9c1e-5b2d-4e8f-9a6c-1d2e3f4a5b6c\",\n    \"decisions\": [\n      {\n        \"interrupt_id\": \"4b08f4dc71e30164e7b49fd74ee911f4\",\n        \"artifact_id\": \"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d\",\n        \"outcome\": \"accepted\",\n        \"selected_source_ids\": [\n          \"b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e\"\n        ]\n      }\n    ]\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Accept Proposed Artifact
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["agent_application": [
    "id": "7f3a9c1e-5b2d-4e8f-9a6c-1d2e3f4a5b6c",
    "decisions": [
      [
        "interrupt_id": "4b08f4dc71e30164e7b49fd74ee911f4",
        "artifact_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
        "outcome": "accepted",
        "selected_source_ids": ["b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e"]
      ]
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.middesk.com/v1/runs/id/resume")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```