> This page is for Paperwork API, version v1 (default).
> For other versions, use one of these documentation indexes:
> - v1 (default): https://docs.cloudraker.com/paperwork/v1/llms.txt

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

# Get an agent run in a space

GET https://api.cloudraker.com/v1/spaces/{spaceId}/agents/{runId}

Returns an agent run started in this space. A run started elsewhere answers `404`.

**Learn more:** [Spaces](https://docs.cloudraker.com/developers/spaces)

Reference: https://docs.cloudraker.com/paperwork/api/spaces/space-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

- `spaceId` (string, required)
- `runId` (string, required)

### Query parameters

- `wait` (integer, optional, default: 0) — How many seconds to hold the request open. Releases early the moment the run finishes **or** blocks on a person. Maximum 120; `0` returns immediately.

## Response

### 200

The run.

- `object` ("agent_run", required)
- `id` (string, required)
- `agent` (V1AgentRunAgent, required)
- `input` (V1AgentRunInput, required)
- `status` (enum, required) — Where the agent run is in its life. | Status | Meaning | | --- | --- | | `queued` | Accepted; its files are still being prepared | | `processing` | The agent is working | | `waiting` | Blocked on a person — see `waiting`, `approvals` and `tasks[]` | | `paused` | Stopped short of finishing and resumable; not a failure | | `completed` | Finished; `result` and `output` are populated | | `failed` | Finished without producing a result | | `cancelled` | Stopped on request | | `expired` | Reached its `expiresAt` without finishing | `completed`, `failed`, `cancelled` and `expired` are terminal. A `completed` run that still had outstanding work also carries `incomplete: true`.
  - Allowed values: `queued`, `processing`, `waiting`, `paused`, `completed`, `failed`, `cancelled`, `expired`
- `progress` (V1AgentRunProgress, required)
- `tasks` (list of V1AgentRunTask, required)
- `statusUrl` (string, required)
- `createdAt` (string, required)
- `expiresAt` (string, required, nullable) — The run’s deadline: about seven days after it starts, an unfinished run parks itself for good and its `status` becomes `expired`. `null` once the run is finished. Files and anything the run already filed are never taken back.
- `finishedAt` (string, required, nullable)
- `waiting` (V1AgentRunWaiting, optional) — What is blocking the run. Present while `status` is `waiting`.
- `paused` (V1AgentRunPaused, optional) — Why the run parked. Present while `status` is `paused`. A paused run keeps everything it produced and can be started again.
- `approvals` (list of V1AgentRunApproval, optional) — Sign-offs the run is waiting on, oldest first.
- `incomplete` (boolean, optional) — Present and `true` on a `completed` run that still had outstanding work — read `tasks[]` to see what.
- `result` (string, optional) — The agent's closing summary.
- `output` (V1AgentRunOutput, optional) — Files attached to the run while its steps were completed, each with a signed download link valid for about an hour.
- `error` (V1AgentRunError, optional) — Why the run failed. Present whenever `status` is `failed`.
- `metadata` (map from string to any, optional)

## Errors

### 400 Bad Request Error

Validation Error

- `success` (boolean, required)
- `error` (list of any, required)
- `data` (any, required)

### 404 Not Found Error

Unknown run, or a run outside this space.

- `any`

### 429 Too Many Requests Error

Rate limited. The `/v1` API allows at least **67 requests per minute per organization** (about 1,000 requests per 15 minutes) — a guaranteed floor, enforced per edge location, so a geographically spread caller may get more. Wait for the `Retry-After` interval and retry — the error is `retryable`.

- `code` (enum, required)
  - Allowed values: `rate_limited`
- `message` (string, required)
- `retryable` (boolean, required)
- `requestId` (string, required)
- `docUrl` (string, optional)

## Types

### V1AgentRunAgent

- `id` (string, required)
- `name` (string, required)
- `version` (double, required)

### V1AgentRunInput

- `files` (list of V1AgentRunInputFilesItems, required) — The immutable input file ids. Reuse these with `agent.id` to start a successor after a terminal run.

### V1AgentRunProgress

- `tasks` (V1AgentRunProgressTasks, required)

### V1AgentRunTask

- `id` (string, required)
- `title` (string, required)
- `executor` (enum, required) — Who performs the step: `agent` runs by itself, `human` waits for a person to complete it.
  - Allowed values: `agent`, `human`
- `status` (enum, required) — Where this step stands. `pending` is blocked on its dependencies, `ready` is claimable, `skipped` satisfies anything waiting on it.
  - Allowed values: `pending`, `ready`, `in_progress`, `completed`, `skipped`
- `summary` (string, required, nullable)
- `completedAt` (string, required, nullable)
- `note` (string, optional)

### V1AgentRunWaiting

What is blocking the run. Present while `status` is `waiting`.

- `approvals` (double, required)
- `tasks` (double, required)
- `summary` (string, required)

### V1AgentRunPaused

Why the run parked. Present while `status` is `paused`. A paused run keeps everything it produced and can be started again.

- `reason` (enum, required)
  - Allowed values: `model_error`, `system_error`

### V1AgentRunApproval

- `id` (string, required)
- `kind` (enum, required)
  - Allowed values: `before`, `output`
- `action` (string, required)
- `requestedAt` (string, required)
- `files` (list of V1AgentRunApprovalFilesItems, required)
- `rationale` (string, optional, nullable)
- `params` (map from string to any, optional) — The inputs proposed for the step, for a `before` approval.

### V1AgentRunOutput

Files attached to the run while its steps were completed, each with a signed download link valid for about an hour.

- `files` (list of V1AgentRunOutputFilesItems, required)

### V1AgentRunError

Why the run failed. Present whenever `status` is `failed`.

- `code` (string, required)
- `message` (string, required)

### V1AgentRunInputFilesItems

- `id` (string, required)

### V1AgentRunProgressTasks

- `total` (double, required)
- `completed` (double, required)

### V1AgentRunApprovalFilesItems

- `id` (string, required)
- `name` (string, required)

### V1AgentRunOutputFilesItems

- `id` (string, required)
- `name` (string, required)
- `url` (string, optional)

## Examples

**Response**

```json
{
  "object": "string",
  "id": "agr_01JQ8ZKMRT4V6WXYZ0ABCDEFGH",
  "agent": {
    "id": "string",
    "name": "string",
    "version": 1.1
  },
  "input": {
    "files": [
      {
        "id": "string"
      }
    ]
  },
  "status": "queued",
  "progress": {
    "tasks": {
      "total": 1.1,
      "completed": 1.1
    }
  },
  "tasks": [
    {
      "id": "string",
      "title": "string",
      "executor": "agent",
      "status": "pending",
      "summary": "string",
      "completedAt": "string",
      "note": "string"
    }
  ],
  "statusUrl": "string",
  "createdAt": "string",
  "expiresAt": "string",
  "finishedAt": "string",
  "waiting": {
    "approvals": 1.1,
    "tasks": 1.1,
    "summary": "string"
  },
  "paused": {
    "reason": "model_error"
  },
  "approvals": [
    {
      "id": "string",
      "kind": "before",
      "action": "string",
      "requestedAt": "string",
      "files": [
        {
          "id": "string",
          "name": "string"
        }
      ],
      "rationale": "string",
      "params": {}
    }
  ],
  "incomplete": true,
  "result": "string",
  "output": {
    "files": [
      {
        "id": "string",
        "name": "string",
        "url": "string"
      }
    ]
  },
  "error": {
    "code": "string",
    "message": "string"
  },
  "metadata": {}
}
```

**SDK Code**

```python
import requests

url = "https://api.cloudraker.com/v1/spaces/spaceId/agents/runId"

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

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

print(response.json())
```

```javascript
const url = 'https://api.cloudraker.com/v1/spaces/spaceId/agents/runId';
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
package main

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

func main() {

	url := "https://api.cloudraker.com/v1/spaces/spaceId/agents/runId"

	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
require 'uri'
require 'net/http'

url = URI("https://api.cloudraker.com/v1/spaces/spaceId/agents/runId")

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
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.cloudraker.com/v1/spaces/spaceId/agents/runId")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.cloudraker.com/v1/spaces/spaceId/agents/runId', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.cloudraker.com/v1/spaces/spaceId/agents/runId");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.cloudraker.com/v1/spaces/spaceId/agents/runId")! 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()
```