---
title: "Device Health Check"
method: GET
path: "/v2/devices/{device_id}/health"
tags: ["Devices"]
---

# Device Health Check

`GET /v2/devices/{device_id}/health`

## Request

- Base URL: `https://api.loyalty.dog`
- URL: `https://api.loyalty.dog/v2/devices/{device_id}/health`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/loyalty/apis/loyaltydog/docs/v2/devices/:device_id/health/get.ts> (a function with typed inputs; its response is checked against the schema)

Health check endpoint for device monitoring.

Called by the device itself using its device-specific JWT token.
The `current_device` dependency handles authentication and updates
lastSeenAt before this handler runs.

### Parameters:
- `device_id` (PydanticObjectId): Must match the device ID in the JWT token
- `device` (Device): Authenticated device from JWT (via current_device)

### Returns:
- `DeviceHealthResponse`: Device health status

### Raises:
- 404: If device_id does not match the authenticated device's ID

## Path parameters

- `device_id` string, required

## Headers

- `authorization` string, nullable

## Response `200`

Successful Response

- DeviceHealthResponse: Response schema for device health check.
  - `status` string, required: Health status (ok/error)
  - `deviceId` string, required: Device ID
  - `lastSeenAt` string, date-time, nullable: Last time the device was active
  - `deviceStatus` 'active' | 'inactive' | 'blocked' | 'pending_activation', required: Device status enumeration.

## Other responses

- `404`: Device not found.
- `422`: Validation Error

---

[API](https://skmtc.dev/loyalty/apis/loyaltydog.md) - [All operations](https://skmtc.dev/loyalty/apis/loyaltydog/llms.txt) - [OpenAPI document](https://skmtc.dev/loyalty/apis/loyaltydog/revisions/5803242b0551?raw)
