---
updatedAt: 2025-07-02T09:12:47.000Z
agentTools:
  projectIndex: https://docs.vitro.io/llms.txt
---

# Get Datacenter

Returns a single datacenter by its identifier. The datacenter must belong to the logged-in tenant.

Apart from the specific details about the datacenter (name, location, etc), the endpoints also returns some statistics about it: the number of batteries grouped by state.  (:exclamation: `alert`, :warning:`warning`, :white\_check\_mark:`stable` or :signal\_strength:`offline`).

<Image align="center" border={false} caption="Datacenter view with stats" src="https://files.readme.io/e2171d6226d4d1e5e295e56e43475dabc6a3fb9114f7c7deb9dd7fb10a736319-image.png" />

# 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": {
    "/datacenter/{datacenterId}": {
      "get": {
        "summary": "Get Datacenter",
        "description": "Returns a single datacenter by its identifier. The datacenter must belong to the logged-in tenant.",
        "operationId": "getDatacenterById",
        "tags": [
          "Standard"
        ],
        "parameters": [
          {
            "name": "datacenterId",
            "in": "path",
            "description": "ID of datacenter to return",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataCenter"
                }
              }
            }
          },
          "400": {
            "description": "Invalid ID supplied"
          },
          "404": {
            "description": "Datacenter not found"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "DataCenter": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "example": 100000
          },
          "name": {
            "type": "string",
            "example": "DataCenterABC"
          },
          "companyId": {
            "type": "integer",
            "format": "int64",
            "example": 10
          },
          "countryCode": {
            "type": "string",
            "example": "US"
          },
          "cityName": {
            "type": "string",
            "example": "New York"
          },
          "groupName": {
            "type": "string",
            "example": "Manhattan"
          },
          "location": {
            "type": "string",
            "example": "37.926868, -78.024902"
          },
          "numberOfOffline": {
            "type": "integer",
            "example": 25,
            "format": "int64"
          },
          "numberOfAlerts": {
            "type": "integer",
            "example": 25,
            "format": "int64"
          },
          "numberOfWarnings": {
            "type": "integer",
            "example": 25,
            "format": "int64"
          },
          "numberOfStable": {
            "type": "integer",
            "example": 25,
            "format": "int64"
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ]
}
```