Autumn Labs
API

Units

Retrieve units data for specified or all accessible stations with optional filters

GET
/units

Authorization

AuthorizationRequiredBearer <token>

In: header

Query Parameters

station_idsstring

Comma-separated list of station IDs

tostring
Default: "2025-06-11T07:25:02.143Z"Format: "date-time"
fromstring
Default: "2025-06-10T07:25:02.144Z"Format: "date-time"
typearray<unknown> | string
serial_numberstring

The serial number of the unit to filter by

directionarray<unknown> | string

Response Body

Response containing units data

TypeScript Definitions

Use the response body type in TypeScript.

dataRequiredarray<object>
messageRequiredstring
metaobject

Standard error response

TypeScript Definitions

Use the response body type in TypeScript.

errorRequiredobject

Standard error response

TypeScript Definitions

Use the response body type in TypeScript.

errorRequiredobject

Standard error response

TypeScript Definitions

Use the response body type in TypeScript.

errorRequiredobject

Standard error response

TypeScript Definitions

Use the response body type in TypeScript.

errorRequiredobject
curl -X GET "https://example.com/units?station_ids=507f1f77bcf86cd799439011%2C507f1f77bcf86cd799439012&to=2025-06-11T07%3A25%3A02.143Z&from=2025-06-10T07%3A25%3A02.144Z&type=sensor&type=actuator&serial_number=string&direction=input&direction=output" \
  -H "Authorization: Bearer <token>"
fetch("https://example.com/units?station_ids=507f1f77bcf86cd799439011%2C507f1f77bcf86cd799439012&to=2025-06-11T07%3A25%3A02.143Z&from=2025-06-10T07%3A25%3A02.144Z&type=sensor&type=actuator&serial_number=string&direction=input&direction=output", {
  headers: {
    "Authorization": "Bearer <token>"
  }
})
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://example.com/units?station_ids=507f1f77bcf86cd799439011%2C507f1f77bcf86cd799439012&to=2025-06-11T07%3A25%3A02.143Z&from=2025-06-10T07%3A25%3A02.144Z&type=sensor&type=actuator&serial_number=string&direction=input&direction=output"

  req, _ := http.NewRequest("GET", url, nil)
  req.Header.Add("Authorization", "Bearer <token>")
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://example.com/units?station_ids=507f1f77bcf86cd799439011%2C507f1f77bcf86cd799439012&to=2025-06-11T07%3A25%3A02.143Z&from=2025-06-10T07%3A25%3A02.144Z&type=sensor&type=actuator&serial_number=string&direction=input&direction=output"

response = requests.request("GET", url, headers = {
  "Authorization": "Bearer <token>"
})

print(response.text)
{
  "data": [
    {
      "station_id": "string",
      "slot": "string",
      "unit_serial": "string",
      "time_inserted": "string",
      "time_created": "string",
      "tz": "string",
      "mode": "string",
      "tags": [
        "string"
      ],
      "unit_type": "string",
      "direction": "input",
      "result": "string",
      "metadata": null
    }
  ],
  "message": "Success",
  "meta": {
    "timestamp": "2019-08-24T14:15:22Z",
    "request_id": "c2ed3e07-8c5f-4be9-b7ec-86bddcedd154",
    "query_duration_ms": 0
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null
  }
}