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

# List the Metric Reports a Device has sent

> The metrics this device reported, over the `health` or `metrics`
extension, as reports: each one a timestamp and the readings the device
took at it, newest first.

History is kept for thirty days. A report keeps only the readings that
were stored: names longer than 64 bytes, values that were not numbers,
and names past the per-report cap were dropped on the way in.

To page back through history, ask for a `limit` and then pass the
`timestamp` of the oldest report you received as the next request's
`before`. A page never ends partway through a report.




## OpenAPI

````yaml https://manage.nervescloud.com/api/openapi get /api/devices/{identifier}/metrics
openapi: 3.0.0
info:
  description: >
    The NervesCloud API gives users full access to their

    Orgs, Products, and corresponding Device fleets.


    The API can be used to integrate with your own systems, providing full
    access to your Product and Device data.


    The API is documented using the OpenAPI 3.0 specification.
  title: NervesCloud API
  version: 2.0.0
servers:
  - url: https://manage.nervescloud.com
    variables: {}
security:
  - bearer_auth: []
tags:
  - description: Archive uploading and downloading
    name: Archives
  - description: User authentication and API token creation
    name: Auth
  - description: Organization Certificate Authority management
    name: CA Certificates
  - description: >-
      Device management, including action requests eg. upgrade, reboot,
      reconnect
    name: Devices
  - description: Log lines Devices have sent over the logging extension
    name: Device Logs
  - description: Metric history Devices have reported over the health or metrics extension
    name: Device Metrics
  - description: >-
      Device management, including action requests eg. upgrade, reboot,
      reconnect
    name: Devices (short URL)
  - description: Device Certificate management
    name: Device Certificates
  - description: Keys and secrets a Device can connect with instead of a certificate
    name: Device Shared Secrets
  - description: Identities a Device holds on networks NervesHub does not run
    name: Network Identities
  - description: Deployment Group and release management
    name: Deployment Groups
  - description: Firmware uploading and management
    name: Firmwares
  - description: Organization iroh endpoint id registration
    name: Iroh Endpoints
  - description: Organization management
    name: Organizations
  - description: Organization User membership management
    name: Organization Members
  - description: Product management
    name: Products
  - description: Organization Signing Key management
    name: Signing Keys
  - description: Product Support Script management
    name: Support Scripts
  - description: Endpoints an Organization sends its Products' Device events to
    name: Webhooks
  - description: Platform healthcheck
    name: Platform Status
paths:
  /api/devices/{identifier}/metrics:
    get:
      tags:
        - Devices (short URL)
      summary: List the Metric Reports a Device has sent
      description: |
        The metrics this device reported, over the `health` or `metrics`
        extension, as reports: each one a timestamp and the readings the device
        took at it, newest first.

        History is kept for thirty days. A report keeps only the readings that
        were stored: names longer than 64 bytes, values that were not numbers,
        and names past the per-report cap were dropped on the way in.

        To page back through history, ask for a `limit` and then pass the
        `timestamp` of the oldest report you received as the next request's
        `before`. A page never ends partway through a report.
      operationId: NervesHubWeb.API.DeviceMetricController.index.short
      parameters:
        - description: Device Identifier
          example: abc123
          in: path
          name: identifier
          required: true
          schema:
            type: string
        - description: >-
            Only these metrics. Comma separated for more than one. Matched as
            given — a name the device has never reported matches nothing, and a
            report that carried none of them is left out
          example: cpu_temp,mem_used_percent
          in: query
          name: key
          required: false
          schema:
            type: string
        - description: >-
            Only reports taken at or after this ISO 8601 timestamp. Inclusive,
            so a client following a device forward from its newest report gets
            that report again
          example: '2026-08-16T09:00:00Z'
          in: query
          name: since
          required: false
          schema:
            format: date-time
            type: string
        - description: >-
            Only reports taken strictly before this ISO 8601 timestamp. To page
            back through history, pass the timestamp of the oldest report you
            received
          example: '2026-08-16T09:14:00.123456Z'
          in: query
          name: before
          required: false
          schema:
            format: date-time
            type: string
        - description: >-
            How many reports to return, from 1 to 1000. Counts reports, not
            readings
          example: '250'
          in: query
          name: limit
          required: false
          schema:
            default: 100
            type: integer
        - description: '`desc` for newest first, `asc` for oldest first'
          example: asc
          in: query
          name: order
          required: false
          schema:
            default: desc
            enum:
              - desc
              - asc
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceMetricReportListResponse'
          description: Device Metric Report List Response
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unusable query parameter
        '501':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: >-
            This platform has no analytics database, so no metric history is
            stored
      callbacks: {}
      deprecated: false
      security:
        - bearer_auth: []
components:
  schemas:
    DeviceMetricReportListResponse:
      description: Device metric report list response
      example:
        data:
          - firmware_uuid: 8f6c3a1e-2b7d-4c55-9e0a-1d2f3b4c5a6e
            metrics:
              cpu_temp: 41.9
              mem_used_percent: 38.5
            timestamp: '2026-08-16T09:14:00.123456Z'
          - firmware_uuid: 8f6c3a1e-2b7d-4c55-9e0a-1d2f3b4c5a6e
            metrics:
              cpu_temp: 41.2
              mem_used_percent: 38
            timestamp: '2026-08-16T09:13:00.004210Z'
      properties:
        data:
          description: The matching reports, newest first unless `order=asc` was given
          items:
            $ref: '#/components/schemas/DeviceMetricReport'
          type: array
      title: DeviceMetricReportListResponse
      type: object
    ErrorResponse:
      description: Error response
      example:
        errors:
          detail: Resource Not Found or Authorization Insufficient
      properties:
        errors:
          properties:
            detail:
              type: string
          type: object
      title: ErrorResponse
      type: object
    DeviceMetricReport:
      description: 'One metrics report from a device: the readings it took at one moment'
      example:
        firmware_uuid: 8f6c3a1e-2b7d-4c55-9e0a-1d2f3b4c5a6e
        metrics:
          cpu_temp: 41.2
          mem_used_percent: 38
        timestamp: '2026-08-16T09:14:00.123456Z'
      properties:
        firmware_uuid:
          description: >-
            The firmware the device was running when it took the readings, if it
            had reported one
          nullable: true
          type: string
        metrics:
          additionalProperties:
            type: number
          description: The readings, keyed by the device's own metric names
          type: object
        timestamp:
          description: When the device took the readings, to microsecond precision
          format: date-time
          type: string
      title: DeviceMetricReport
      type: object
  securitySchemes:
    bearer_auth:
      description: >
        A user API token, or a product API key created in a product's settings.


        A product API key only works on the routes for its own product, under

        `/api/orgs/{org_name}/products/{product_name}`, and on
        `/api/devices/{identifier}`

        for that product's devices. What it may do there is decided by the role
        it

        holds, the same way a member's role decides what they may do.
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.