> ## Documentation Index
> Fetch the complete documentation index at: https://altostrat.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Recent Device Health Stats

> Retrieves a time-series of key health metrics (CPU, memory, disk, uptime) for a specific site's device from the last 8 hours.



## OpenAPI

````yaml /api/en/monitoring-metrics.yaml get /metrics/mikrotik-stats-all/{siteId}
openapi: 3.0.3
info:
  title: Altostrat Monitoring & Metrics API
  version: 1.0.0
  description: >-
    Retrieve portal-facing metrics through the public `/metrics` gateway path,
    including dashboards, WAN tunnels, interfaces, ARP entries, syslogs, BGP,
    and DNS reports.
servers:
  - url: https://v1.api.altostrat.io
security:
  - bearerAuth: []
tags:
  - name: Dashboard
    description: High-level, aggregated metrics for network performance and data usage.
  - name: WAN Tunnels & Performance
    description: >-
      Endpoints for managing and retrieving performance data from SD-WAN
      tunnels.
  - name: Site Interfaces & Metrics
    description: >-
      Endpoints for listing network interfaces at a site and fetching their
      traffic metrics.
  - name: Device Health & Status
    description: Endpoints for monitoring the health and status of network devices.
  - name: ARP Inventory
    description: >-
      Endpoints for querying and managing the Address Resolution Protocol (ARP)
      table to discover devices on the network.
  - name: Network Logs
    description: Access to system, DNS, and BGP logs for diagnostics and security analysis.
  - name: Grafana Dashboards
    description: List Grafana dashboards, query dashboard panels, and export panel data.
  - name: Prometheus Querying
    description: >-
      Discover available metrics and labels, then execute Prometheus queries
      scoped to your workspace.
paths:
  /metrics/mikrotik-stats-all/{siteId}:
    get:
      tags:
        - Device Health & Status
      summary: Get Recent Device Health Stats
      description: >-
        Retrieves a time-series of key health metrics (CPU, memory, disk,
        uptime) for a specific site's device from the last 8 hours.
      parameters:
        - $ref: '#/components/parameters/SiteId'
      responses:
        '200':
          description: A list of device health statistics.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DeviceHealthStats'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '410':
          description: Gone - The specified site ID is incorrect or no longer exists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    SiteId:
      name: siteId
      in: path
      required: true
      description: The unique identifier for the site.
      schema:
        type: string
        format: uuid
        example: d8f8f8f8-f8f8-f8f8-f8f8-f8f8f8f8f8f8
  schemas:
    DeviceHealthStats:
      type: object
      properties:
        uptime:
          type: string
          description: The device's uptime.
          example: 3d14h25m10s
        cpu:
          type: integer
          description: The CPU load percentage.
          example: 15
        free_memory:
          type: number
          format: float
          description: Free memory in megabytes (MB).
          example: 128.54
        free_hdd:
          type: number
          format: float
          description: Free disk space in megabytes (MB).
          example: 89.12
        created_at:
          type: string
          description: The formatted timestamp when the stats were recorded.
          example: 29 Oct 2025 12:59:33
    ErrorResponse:
      type: object
      properties:
        type:
          type: string
          description: A broad category for the error (e.g., 'invalid_request_error').
          example: invalid_request_error
        code:
          type: string
          description: A short, unique string identifying the specific error.
          example: parameter_invalid
        message:
          type: string
          description: A human-readable description of what went wrong.
          example: The provided 'siteId' is not a valid UUID.
        doc_url:
          type: string
          description: >-
            A direct link to the documentation page for this specific error
            code.
          example: https://docs.altostrat.io/errors/parameter_invalid
  responses:
    Unauthorized:
      description: Unauthorized - The request lacks valid authentication credentials.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````