> 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.

# Retrieve an agent run

GET https://api.middesk.com/v1/runs/{id}

Retrieves details of a specific agent run

Reference: https://docs.middesk.com/api-reference/agents/runs/get-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

### Query parameters

- `include` (string, optional) — Comma-separated list of optional sub-resources to include. Pass `steps` to populate the `steps` array with this run's execution trace; omitted by default to avoid the cost of fetching step state from the underlying execution backend.

## Response

### 200

agent run found

- `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. To resume a run, POST the interrupt's `id` along with the caller-supplied input to `POST /v1/runs/{id}/resume`.
- `steps` (list of AgentsStep, optional) — Top-level execution steps for this run. Opt-in: pass `?include=steps` on `GET /v1/runs/{id}` (or `POST /v1/runs/{id}/resume`) to populate this field. Omitted by default to avoid the cost of fetching step state from the underlying execution backend.

## Errors

### 404 Get Agent Run Request Not Found Error

agent run not found

- `errors` (list of ErrorResponseErrorsItem, required)

## Types

### 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

### 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`

### 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

### Completed run

**Response**

```json
{
  "object": "run",
  "id": "9f1b2c34-5678-4abc-9def-0123456789ab",
  "created_at": "2026-04-30T18:42:11Z",
  "updated_at": "2026-04-30T18:42:38Z",
  "status": "completed",
  "thread_id": "1aaa2bbb-3ccc-4ddd-8eee-fffaaa111222",
  "business_id": "business_id",
  "agent": "cip_orchestrator",
  "requester": {
    "id": "u1234567-89ab-4cde-9012-345678901234",
    "name": "Jane Reviewer",
    "email": "jane@example.com"
  },
  "started_at": "2026-04-30T18:42:12Z",
  "ended_at": "2026-04-30T18:42:38Z",
  "output": {
    "artifacts": [
      {
        "title": "CIP verification summary",
        "type": "cip_summary",
        "confidence": "high",
        "summary": "Verified business identity against SOS, IRS, and watchlist sources.",
        "sources": [
          {
            "url": "https://example-sos.gov/business/12345",
            "source_name": "Delaware Secretary of State",
            "source_tier": "primary",
            "source_type": "sos"
          }
        ]
      }
    ]
  },
  "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 Completed run
import requests

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

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Completed run
const url = 'https://api.middesk.com/v1/runs/id';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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

```go Completed run
package main

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

func main() {

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

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

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

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

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

}
```

```ruby Completed run
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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

```java Completed run
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.middesk.com/v1/runs/id")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Completed run
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.middesk.com/v1/runs/id', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Completed run
using RestSharp;

var client = new RestClient("https://api.middesk.com/v1/runs/id");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Completed run
import Foundation

let headers = ["Authorization": "Bearer <token>"]

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

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()
```

### Errored run

**Response**

```json
{
  "object": "run",
  "id": "ab23cd45-6789-40ab-9cde-f01234567890",
  "created_at": "2026-04-30T18:50:02Z",
  "updated_at": "2026-04-30T18:50:14Z",
  "status": "error",
  "thread_id": "2bbb3ccc-4ddd-4eee-9fff-aaa111222333",
  "business_id": "business_id",
  "agent": "cip_orchestrator",
  "requester": {
    "id": "acc12345-6789-4abc-9def-012345678901",
    "name": "Example Account"
  },
  "started_at": "2026-04-30T18:50:03Z",
  "ended_at": "2026-04-30T18:50:14Z",
  "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 Errored run
import requests

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

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Errored run
const url = 'https://api.middesk.com/v1/runs/id';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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

```go Errored run
package main

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

func main() {

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

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

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

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

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

}
```

```ruby Errored run
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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

```java Errored run
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.middesk.com/v1/runs/id")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Errored run
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.middesk.com/v1/runs/id', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Errored run
using RestSharp;

var client = new RestClient("https://api.middesk.com/v1/runs/id");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Errored run
import Foundation

let headers = ["Authorization": "Bearer <token>"]

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

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()
```

### Interrupted run awaiting input

**Response**

```json
{
  "object": "run",
  "id": "cd34ef56-7890-41bc-8def-123456789012",
  "created_at": "2026-04-30T19:02:30Z",
  "updated_at": "2026-04-30T19:02:45Z",
  "status": "interrupted",
  "thread_id": "3ccc4ddd-5eee-4fff-8aaa-111222333444",
  "business_id": "business_id",
  "agent": "cip_orchestrator",
  "requester": {
    "id": "u1234567-89ab-4cde-9012-345678901234",
    "name": "Jane Reviewer",
    "email": "jane@example.com"
  },
  "started_at": "2026-04-30T19:02:31Z",
  "interrupts": [
    {
      "id": "4b08f4dc71e30164e7b49fd74ee911f4",
      "value": {
        "agent": "cip_orchestrator",
        "label": "Review and approve proposed changes",
        "proposals": [
          {
            "agent": "people_verification",
            "artifacts": [
              {
                "confidence": "strong",
                "sources": [
                  {
                    "source_name": "Example Profile",
                    "source_tier": "public_alternative",
                    "source_type": "profile",
                    "url": "https://example.com/profiles/jane-doe"
                  }
                ],
                "summary": "Public profile confirms Jane Doe's association with the business as an Engineering Lead.",
                "title": "Jane Doe",
                "type": "person"
              }
            ],
            "label": "Add verified people sources to the report?"
          }
        ],
        "type": "combined_proposal"
      },
      "agent": "cip_orchestrator"
    }
  ],
  "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 Interrupted run awaiting input
import requests

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

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Interrupted run awaiting input
const url = 'https://api.middesk.com/v1/runs/id';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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

```go Interrupted run awaiting input
package main

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

func main() {

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

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

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

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

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

}
```

```ruby Interrupted run awaiting input
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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

```java Interrupted run awaiting input
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.middesk.com/v1/runs/id")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Interrupted run awaiting input
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.middesk.com/v1/runs/id', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Interrupted run awaiting input
using RestSharp;

var client = new RestClient("https://api.middesk.com/v1/runs/id");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Interrupted run awaiting input
import Foundation

let headers = ["Authorization": "Bearer <token>"]

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

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()
```