# A server's live status

Source: https://openpanel.sh/docs/api/servers/a-server-s-live-status

Whether its agent is online, and what it last reported running against what OpenPanel wants it to run.

`GET https://openpanel.sh/api/v1/servers/{serverId}/status`

## Parameters

| Name | In | Required | Description |
|---|---|---|---|
| `serverId` | path | yes |  |

## Responses

| Status | Meaning | Body |
|---|---|---|
| 200 | A server's live status | `application/json`, `ServerStatus` |
| 401 | No valid credential was sent. | `application/problem+json`, `Problem` |
| 403 | The credential may not do this. | `application/problem+json`, `Problem` |
| 404 | Not found, or not visible to this credential. | `application/problem+json`, `Problem` |
| 422 | The input was refused; detail says why. | `application/problem+json`, `Problem` |
| 429 | Too many requests; wait for Retry-After seconds. | `application/problem+json`, `Problem` |

## Schemas

### Problem

```json
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "description": "A link to the error's explanation in the docs."
    },
    "title": {
      "type": "string"
    },
    "status": {
      "type": "integer"
    },
    "code": {
      "type": "string",
      "description": "Stable machine-readable code: not_found, forbidden, invalid, conflict, rate_limited, not_implemented, …"
    },
    "detail": {
      "type": "string",
      "description": "What went wrong, in a sentence written for a person."
    }
  },
  "required": [
    "type",
    "title",
    "status",
    "code",
    "detail"
  ]
}
```

### ServerStatus

```json
{
  "type": "object",
  "properties": {
    "serverId": {
      "type": "string",
      "format": "uuid"
    },
    "status": {
      "type": "string",
      "enum": [
        "connecting",
        "ready",
        "failed",
        "disconnecting",
        "released"
      ]
    },
    "agent": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "online": {
              "type": "boolean"
            },
            "version": {
              "type": "string"
            },
            "lastSeenAt": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ]
            },
            "enrolledAt": {
              "type": "string",
              "format": "date-time"
            }
          },
          "required": [
            "online",
            "version",
            "lastSeenAt",
            "enrolledAt"
          ]
        },
        {
          "type": "null"
        }
      ],
      "description": "The OpenPanel agent on the server, once it is installed."
    },
    "desiredRevision": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "description": "The latest state OpenPanel wants the server to run."
    },
    "observed": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "desiredRevision": {
              "type": "integer"
            },
            "observedAt": {
              "type": "string",
              "format": "date-time"
            },
            "state": {},
            "metrics": {}
          },
          "required": [
            "desiredRevision",
            "observedAt",
            "state",
            "metrics"
          ]
        },
        {
          "type": "null"
        }
      ],
      "description": "What the agent last reported."
    }
  },
  "required": [
    "serverId",
    "status",
    "agent",
    "desiredRevision",
    "observed"
  ]
}
```