---
agentTools:
  projectIndex: https://developer.moxionpower.com/llms.txt
---

# Get Device Faults

Gets a set of Timestamped Faults for a device. The time range of Faults is specified with the start and end parameters, including start and excluding end - [start, end). The max duration cannot exceed 1 day.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "paths": {
    "/v1/api/organizations/{org_id}/devices/{device_id}/faults": {
      "get": {
        "operationId": "DeviceFaultsController_listFaults",
        "summary": "Get Device Faults",
        "description": "Gets a set of Timestamped Faults for a device. The time range of Faults is specified with the start and end parameters, including start and excluding end - [start, end). The max duration cannot exceed 1 day.",
        "parameters": [
          {
            "name": "org_id",
            "required": true,
            "in": "path",
            "description": "ID of the Organazation that owns the Device",
            "example": "e0825da3-c63b-4c06-8460-18590c81f289",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "device_id",
            "required": true,
            "in": "path",
            "description": "ID of the Device",
            "example": "c4a02f0a-ddcd-4f13-b68d-4213dd0c53c8",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start",
            "required": true,
            "in": "query",
            "description": "The start timestamp (inclusive) of the period to query.  Max duration between \"start\" and \"end\" is 1 day.",
            "example": "2023-03-14T15:59:26Z",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "end",
            "required": true,
            "in": "query",
            "description": "The end timestamp (exlusive) of the period to query. Max duration between \"start\" and \"end\" is 1 day.",
            "example": "2023-03-15T15:59:26Z",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TimestampedFault"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "404": {
            "description": "Organization or device not found"
          }
        },
        "tags": [
          "Faults"
        ],
        "security": [
          {
            "api_key": []
          }
        ]
      }
    }
  },
  "info": {
    "title": "Moxion Developer API",
    "description": "The Moxion Developer API",
    "version": "0.1",
    "contact": {
      "name": "Moxion Power",
      "url": "",
      "email": "help@moxionpower.com"
    },
    "termsOfService": "https://moxionpower.com/terms"
  },
  "servers": [
    {
      "url": "https://api-production.infra.moxionpower.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "api_key": {
        "type": "apiKey",
        "in": "header",
        "name": "authorization"
      }
    },
    "schemas": {
      "TimestampedFault": {
        "type": "object",
        "properties": {
          "time": {
            "type": "string",
            "description": "Timestamp of the Fault formatted as iso8601",
            "example": "2023-07-07T00:00:00Z",
            "format": "date-time"
          },
          "fault_code": {
            "type": "string",
            "description": "Fault Code, which represents the type of fault",
            "example": "BMS_CRITICAL"
          }
        },
        "required": [
          "time",
          "fault_code"
        ]
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 100,
      "1": 94,
      "2": 203,
      "3": 249,
      "4": 42,
      "5": 156,
      "6": 180,
      "7": 0,
      "8": 11,
      "9": 238,
      "10": 183,
      "11": 220
    }
  }
}
```