---
updatedAt: 2025-07-02T08:17:11.000Z
agentTools:
  projectIndex: https://docs.vitro.io/llms.txt
---

# List battery services

List the service history of a battery in a given time range

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Astra HTTP API",
    "description": "API Specification for the ASTRA backend, which will expose datacenters and battery information for the UI application to construct dashboards. ",
    "contact": {
      "email": "rafal@kult.io"
    },
    "version": "1.0-BETA"
  },
  "servers": [
    {
      "url": "https://api.dev.vitro.link/api/",
      "description": "Development"
    }
  ],
  "tags": [
    {
      "name": "Standard"
    }
  ],
  "paths": {
    "/serviceHistory/findByBattery": {
      "get": {
        "summary": "List battery services",
        "description": "List the service history of a battery in a given time range",
        "operationId": "getServiceHistory",
        "tags": [
          "Standard"
        ],
        "parameters": [
          {
            "name": "batteryId",
            "in": "query",
            "description": "ID of battery to return",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start",
            "in": "query",
            "description": "Start date of the history",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Last number of history entries",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ArrayOfServiceHistory"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid data supplied"
          },
          "404": {
            "description": "History not found"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ServiceHistory": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "example": 10
          },
          "category": {
            "$ref": "#/components/schemas/ServiceHistoryCategory"
          },
          "batteryId": {
            "type": "string"
          },
          "service_datetime": {
            "type": "string",
            "example": "2013-03-01T13:05:16",
            "format": "date-time"
          },
          "description": {
            "type": "string",
            "example": "This is a description of the service"
          },
          "author": {
            "type": "string",
            "example": "John Doe"
          }
        }
      },
      "ArrayOfServiceHistory": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/ServiceHistory"
        }
      },
      "ServiceHistoryCategory": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "ServiceHistoryCategoryABC"
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ]
}
```