# List connected machines — API reference

> Lists the machines connected with keys of the Company, with online state, last run, last action left to another machine and offline alarm.

Source: https://upfour.io/docs/api/runners/list-connected-machines

[Developers](https://upfour.io/docs/api.md)/[Connected machines](https://upfour.io/docs/api/runners.md)

Lists the machines connected with keys of the Company, with online state, last run, last action left to another machine and offline alarm.

GET https://app.upfour.io/v1/runners

scope api_key.read stable returns 200

## Returns

A successful request returns `200` with application/json.

Response fields 2 top-level fields

| Field | Type | Description |
| --- | --- | --- |
| `data` | RunnerView[]  · nullable | |
| Each item · 41 fields FieldTypeDescription `arch` string `cli_version` string `connected_since` string (date-time)  · nullable Start of the oldest open stream. Null while offline. `delivery` RunnerDeliveryView Delivery time from confirmation to the machine over the last 7 days. Suspicion events are measured apart. RunnerDeliveryView · 8 fields FieldTypeDescription `last_event_at` string (date-time)  · nullable `p50_ms` integer  · nullable Null without samples. `p95_ms` integer  · nullable Null without samples. `samples` integer `suspicion` RunnerLatencyView RunnerLatencyView · 3 fields FieldTypeDescription `p50_ms` integer  · nullable Null without samples. `p95_ms` integer  · nullable Null without samples. `samples` integer `event_types` string[]  · nullable Confirmed event types the machine receives. Null receives every type of the webhook catalogue except webhook.test. `first_seen_at` string (date-time) `host` string Host name the CLI reports with X-Up4-Runner-Host. Display only. `id` uuid `key` RunnerKeyView  · nullable The API key the machine used last. Null when that key was deleted. RunnerKeyView · 4 fields FieldTypeDescription `allowed_clients` uuid[]  · nullable Clients the key is limited to. Empty: the key reaches the company and every client. `id` uuid `name` string `scopes` string[]  · nullable Permission scopes the key carries, for example runner.stream.read. `last_deferred` RunnerDeferralView  · nullable The latest action the machine left to another machine because that one held the lock. Null without one. RunnerDeferralView · 4 fields FieldTypeDescription `at` string (date-time) `handler` string `runner_id` uuid The machine that held the lock. `runner_name` string `last_run` RunnerLastRunView  · nullable The latest handler run the machine reported, started or finished. Null without one, or when its client is outside your access. RunnerLastRunView · 6 fields FieldTypeDescription `at` string (date-time) When upfour received the latest report of the run. `client_id` uuid  · nullable The incident's client. Null at company level. `handler` string `incident_id` uuid `kind` string `outcome` string  · nullable one of`succeeded` `failed` `timeout` `unknown` Null while the run is in progress. unknown: the machine stopped reporting mid-run and its lock expired; no other machine repeated the action. `last_seen_at` string (date-time) `name` string Display name. Taken from X-Up4-Runner-Name on the first connection; a rename here sticks across later connections. `offline_alert` RunnerOfflineAlertView The offline alarm. While enabled, upfour keeps a scheduled job for the machine that turns down after grace_seconds without a connection, with the alerts of a scheduled job. RunnerOfflineAlertView · 2 fields FieldTypeDescription `enabled` boolean `grace_seconds` integer Seconds without a connection before the alarm. `online` boolean True while at least one stream of the machine is open on any instance. `os` string `suspicion_enabled` boolean Whether the machine also receives monitor.suspected and monitor.suspicion_cleared, the unconfirmed early warnings. | | |
| `pagination` | Pagination | |
| Pagination · 5 fields FieldTypeDescription `cursor` string  · nullable `has_more` boolean `limit` integer 1–250 `next_cursor` string  · nullable `prev_cursor` string  · nullable | | |

## Errors

Only the errors this operation can return. Every error uses the [same envelope](https://upfour.io/docs/api/responses.md).

| Status | Code | Meaning |
| --- | --- | --- |
| 400 | [bad_request](https://upfour.io/docs/api/errors#code-bad_request) | The request is malformed or fails validation. |
| 404 | [not_found](https://upfour.io/docs/api/errors#code-not_found) | The requested resource does not exist or is outside the caller's scope. |
| 403 | [permission_denied](https://upfour.io/docs/api/errors#code-permission_denied) | The credentials do not permit this action. |
| 503 | [service_unavailable](https://upfour.io/docs/api/errors#code-service_unavailable) | The service or a required dependency is temporarily unavailable. |

Every call can also return `unauthorized` (401), `rate_limit_exceeded` (429) or `internal_error` (500 / 502). See [Responses and errors](https://upfour.io/docs/api/responses.md).

[NextUpdate a connected machine](https://upfour.io/docs/api/runners/update-a-connected-machine.md)

## Request

### cURL

```bash
curl -s "https://app.upfour.io/v1/runners" \
  -H "Authorization: Bearer $UP4_API_KEY"
```

### JavaScript

```javascript
const res = await fetch("https://app.upfour.io/v1/runners", {
  headers: {
    Authorization: `Bearer ${process.env.UP4_API_KEY}`,
  },
});
console.log(res.status, await res.json());
```

### Python

```python
import os
import requests

res = requests.get(
    "https://app.upfour.io/v1/runners",
    headers={"Authorization": f"Bearer {os.environ['UP4_API_KEY']}"},
)
print(res.status_code, res.json())
```

### Go

```go
package main

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

func main() {
	req, _ := http.NewRequest("GET", "https://app.upfour.io/v1/runners", nil)
	req.Header.Set("Authorization", "Bearer "+os.Getenv("UP4_API_KEY"))
	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()
	out, _ := io.ReadAll(res.Body)
	fmt.Println(res.StatusCode, string(out))
}
```

### PHP

```php
<?php
$ch = curl_init("https://app.upfour.io/v1/runners");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("UP4_API_KEY"),
    ],
]);
$response = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), " ", $response, "\n";
curl_close($ch);
```

## Response

### 200

```json
{
  "data": [
    {
      "arch": "amd64",
      "cli_version": "1.0.0",
      "connected_since": "2026-11-19T08:00:00Z",
      "delivery": {
        "last_event_at": "2026-11-19T08:42:10Z",
        "p50_ms": 180,
        "p95_ms": 420,
        "samples": 128,
        "suspicion": {
          "p50_ms": null,
          "p95_ms": null,
          "samples": 0
        }
      },
      "event_types": [
        "incident.opened",
        "incident.resolved"
      ],
      "first_seen_at": "2026-11-12T09:30:00Z",
      "host": "build-01.internal",
      "id": "00000000-0000-4000-8000-000000000001",
      "key": {
        "allowed_clients": [],
        "id": "00000000-0000-4000-8000-000000000002",
        "name": "Build server",
        "scopes": [
          "runner.stream.read",
          "incident.read",
          "runner.report.write"
        ]
      },
      "last_deferred": null,
      "last_run": {
        "at": "2026-11-19T08:42:14Z",
        "client_id": null,
        "handler": "restart-php-fpm",
        "incident_id": "00000000-0000-4000-8000-000000000003",
        "kind": "exec",
        "outcome": "succeeded"
      },
      "last_seen_at": "2026-11-19T09:00:00Z",
      "name": "build-01",
      "offline_alert": {
        "enabled": true,
        "grace_seconds": 300
      },
      "online": true,
      "os": "linux",
      "suspicion_enabled": false
    }
  ],
  "pagination": {
    "cursor": null,
    "has_more": false,
    "limit": 50,
    "next_cursor": null,
    "prev_cursor": null
  }
}
```

### 400

```json
{
  "error": {
    "code": "bad_request",
    "message": "The request is malformed or fails validation.",
    "request_id": "req_…"
  }
}
```

### 403

```json
{
  "error": {
    "code": "permission_denied",
    "message": "The credentials do not permit this action.",
    "request_id": "req_…"
  }
}
```

### 404

```json
{
  "error": {
    "code": "not_found",
    "message": "The requested resource does not exist or is outside the caller's scope.",
    "request_id": "req_…"
  }
}
```

### 503

```json
{
  "error": {
    "code": "service_unavailable",
    "message": "The service or a required dependency is temporarily unavailable.",
    "request_id": "req_…"
  }
}
```
