Skip to main content

Metrics API

The Metrics API provides endpoints for retrieving high-level dashboard metrics, including ROI calculations, asset counts, and system health indicators.

Endpoints Overview

MethodEndpointDescription
GET/metricsList all metrics
GET/metrics/{id}Get specific metrics

List Metrics

Retrieves metrics records with optional filtering.

Endpoint: GET /metrics

Authentication: Required

Query Parameters:

ParameterTypeDescription
companyNamestringFilter by company name
siteNamestringFilter by site name
limitintegerMaximum number of results (default: 100)

Response:

{
"items": [
{
"id": "a826a2f8-ceee-45ac-9ebd-4522c4202027",
"companyName": "Acme Corp",
"siteName": "Main Plant",
"numAssets": 103,
"saving": "442500",
"roi": "9.59",
"hardwareCost": "30000",
"softwareCost": "300",
"contractStartDate": "2024-01-01T00:00:00.000000Z",
"inactiveSensorsCount": 1,
"inactiveSensorsDetails": "[{\"assetName\":\"Conveyor A\",\"sensorId\":\"5f5ad067804c\"}]",
"inactiveVibrationThreshold": "0.095",
"createdAt": "2024-04-12T01:08:53.008Z",
"updatedAt": "2025-12-02T23:00:44.391Z"
}
],
"count": 1
}

Example Request:

curl -X GET "https://api.acme.f7i.ai/prod/metrics?companyName=Acme%20Corp&siteName=Main%20Plant" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"

Get Metrics

Retrieves a specific metrics record by ID.

Endpoint: GET /metrics/{id}

Authentication: Required

Path Parameters:

ParameterTypeDescription
idstringUnique identifier of the metrics record

Response:

{
"id": "a826a2f8-ceee-45ac-9ebd-4522c4202027",
"companyName": "Acme Corp",
"siteName": "Main Plant",
"numAssets": 103,
"saving": "442500",
"roi": "9.59",
"hardwareCost": "30000",
"softwareCost": "300",
"contractStartDate": "2024-01-01T00:00:00.000000Z",
"inactiveSensorsCount": 1,
"inactiveSensorsDetails": "[{\"assetName\":\"Conveyor A\",\"sensorId\":\"5f5ad067804c\"}]",
"inactiveVibrationThreshold": "0.095",
"createdAt": "2024-04-12T01:08:53.008Z",
"updatedAt": "2025-12-02T23:00:44.391Z"
}

Example Request:

curl -X GET "https://api.acme.f7i.ai/prod/metrics/a826a2f8-ceee-45ac-9ebd-4522c4202027" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"

Response Fields

ROI & Cost Metrics

FieldTypeDescription
savingstringTotal estimated savings in dollars
roistringReturn on investment multiplier
hardwareCoststringTotal hardware investment in dollars
softwareCoststringMonthly software cost in dollars
contractStartDatestringContract start date (ISO 8601)

Asset Metrics

FieldTypeDescription
numAssetsintegerTotal number of monitored assets
inactiveSensorsCountintegerNumber of sensors with no recent activity
inactiveSensorsDetailsstringJSON array of inactive sensor details
inactiveVibrationThresholdstringVibration threshold for inactive classification (mm/s)

Inactive Sensors Details

The inactiveSensorsDetails field contains a JSON string with details about sensors that haven't reported data recently:

[
{
"assetName": "Conveyor A",
"sensorId": "5f5ad067804c"
}
]

Error Responses

400 Bad Request

{
"error": "Invalid request",
"details": {
"companyName": "Company name is required"
}
}

404 Not Found

{
"error": "Item not found"
}

500 Internal Server Error

{
"error": "Internal server error: [error details]"
}