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

# Get an instrument's device status history

GET https://platform.labric.co/api/v1/instruments/{instrument_id}/device-status

Get an instrument's device status history.

Returns the current status of the instrument's paired device and the periods
it was online, offline, or in error, trimmed to the range and oldest first.
Gaps between the device's reports are returned as offline periods.
current_status gives the status now and when it began, or is null if the
device has never reported; it is offline since the last heartbeat once the
device stops sending heartbeats. Use it to answer questions about connectivity
or to reason over it, such as counting disconnections, comparing instruments,
or lining up offline periods with runs. Times are ISO 8601 with a UTC offset.
end_time defaults to and is capped at now, and start_time defaults to 7 days
before end_time. A range with more than 200 periods returns the most recent
200. The "notes" field flags when the range was adjusted, e.g. because the end
was capped at now or earlier periods were dropped.

Requires an API key with the `read` scope.

Reference: https://docs.labric.co/api-reference/labric-api/instruments/get-device-status-history

## Authentication

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

## Request

### Path parameters

- `instrument_id` (string, required)

### Query parameters

- `start_time` (datetime, optional, nullable)
- `end_time` (datetime, optional, nullable)

## Response

### 200

OK

- `instrument` (InstrumentNameSchema, required)
- `start_time` (datetime, required)
- `end_time` (datetime, required)
- `current_status` (CurrentDeviceStatusSchema, required, nullable) — The device's status now, or null if it never reported
- `statuses` (list of DeviceStatusSchema, required) — Status periods in the range, oldest first
- `notes` (list of string, required) — How the returned range differs from the requested one

## Errors

### 400 Bad Request Error

Bad Request

- `detail` (string, required)

### 401 Unauthorized Error

Unauthorized

- `detail` (string, required)

### 403 Forbidden Error

Forbidden

- `detail` (string, required)

### 404 Not Found Error

Not Found

- `detail` (string, required)

### 422 Unprocessable Entity Error

Unprocessable Content

- `detail` (list of map from string to any, required)

### 500 Internal Server Error

Internal Server Error

- `detail` (string, required)

## Types

### InstrumentNameSchema

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

### CurrentDeviceStatusSchema

- `value` (CurrentDeviceStatusSchemaValue, required)
- `since` (datetime, required) — When the current status began

### DeviceStatusSchema

- `status` (DeviceStatusSchemaStatus, required)
- `first_seen` (datetime, required)
- `last_seen` (datetime, required)
- `app_version` (string, optional, nullable)

### CurrentDeviceStatusSchemaValue

- DeviceStatusType: enum
  - Allowed values: `online`, `offline`, `error`
- string

### DeviceStatusSchemaStatus

- DeviceStatusType: enum
  - Allowed values: `online`, `offline`, `error`
- string

## Examples

**Response**

```json
{
  "instrument": {
    "id": "string",
    "name": "string"
  },
  "start_time": "2024-01-15T09:30:00Z",
  "end_time": "2024-01-15T09:30:00Z",
  "current_status": {
    "value": "online",
    "since": "2024-01-15T09:30:00Z"
  },
  "statuses": [
    {
      "status": "online",
      "first_seen": "2024-01-15T09:30:00Z",
      "last_seen": "2024-01-15T09:30:00Z",
      "app_version": "string"
    }
  ],
  "notes": [
    "string"
  ]
}
```

**SDK Code**

```python
import requests

url = "https://platform.labric.co/api/v1/instruments/instrument_id/device-status"

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

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

print(response.json())
```