{
  "openapi": "3.1.0",
  "info": {
    "version": "1.1.0",
    "title": "TrackingAPI",
    "description": "V1 API for retrieving tracking data and changing settings on Lightbug devices"
  },
  "paths": {
    "/devices/{id}/points/{fk}": {
      "get": {
        "tags": [
          "device"
        ],
        "summary": "Retrieve a specific point for a device",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          },
          {
            "name": "fk",
            "in": "path",
            "description": "Foreign key for points",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Body (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/datapoint"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/datapoint"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/datapoint"
                }
              },
              "application/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/datapoint"
                }
              },
              "text/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/datapoint"
                }
              }
            }
          }
        },
        "deprecated": false
      },
      "delete": {
        "tags": [
          "device"
        ],
        "summary": "Delete a specific point for a device",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          },
          {
            "name": "fk",
            "in": "path",
            "description": "Foreign key for points",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Request was successful"
          }
        },
        "deprecated": false
      }
    },
    "/devices/{id}/config": {
      "get": {
        "tags": [
          "device"
        ],
        "summary": "Retrieve configuration for a device",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          },
          {
            "name": "refresh",
            "description": "unused",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Body (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/deviceConfig"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/deviceConfig"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/deviceConfig"
                }
              },
              "application/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/deviceConfig"
                }
              },
              "text/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/deviceConfig"
                }
              }
            }
          }
        },
        "deprecated": false
      },
      "put": {
        "tags": [
          "device"
        ],
        "summary": "Update configuration for a device",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/deviceConfig"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/deviceConfig"
              }
            },
            "application/xml": {
              "schema": {
                "$ref": "#/components/schemas/deviceConfig"
              }
            },
            "text/xml": {
              "schema": {
                "$ref": "#/components/schemas/deviceConfig"
              }
            }
          },
          "description": "Body (JSON)"
        },
        "responses": {
          "200": {
            "description": "Body (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/deviceConfig"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/deviceConfig"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/deviceConfig"
                }
              },
              "application/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/deviceConfig"
                }
              },
              "text/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/deviceConfig"
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/devices/{id}/readings/{fk}": {
      "get": {
        "tags": [
          "device"
        ],
        "summary": "Retrieve a specific reading for a device",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          },
          {
            "name": "fk",
            "in": "path",
            "description": "Foreign key for readings",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Body (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/sensorReading"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/sensorReading"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/sensorReading"
                }
              },
              "application/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/sensorReading"
                }
              },
              "text/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/sensorReading"
                }
              }
            }
          }
        },
        "deprecated": false
      },
      "delete": {
        "tags": [
          "device"
        ],
        "summary": "Delete a related item by id for readings.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          },
          {
            "name": "fk",
            "in": "path",
            "description": "Foreign key for readings",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Request was successful"
          }
        },
        "deprecated": false
      }
    },
    "/devices/{id}/gatewayReadings/{fk}": {
      "get": {
        "tags": [
          "device"
        ],
        "summary": "Find a related item by id for gatewayReadings.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          },
          {
            "name": "fk",
            "in": "path",
            "description": "Foreign key for gatewayReadings",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Body (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/sensorReading"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/sensorReading"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/sensorReading"
                }
              },
              "application/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/sensorReading"
                }
              },
              "text/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/sensorReading"
                }
              }
            }
          }
        },
        "deprecated": false
      },
      "delete": {
        "tags": [
          "device"
        ],
        "summary": "Delete a related item by id for gatewayReadings.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          },
          {
            "name": "fk",
            "in": "path",
            "description": "Foreign key for gatewayReadings",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Request was successful"
          }
        },
        "deprecated": false
      },
      "put": {
        "tags": [
          "device"
        ],
        "summary": "Update a related item by id for gatewayReadings.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          },
          {
            "name": "fk",
            "in": "path",
            "description": "Foreign key for gatewayReadings",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/sensorReading"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/sensorReading"
              }
            },
            "application/xml": {
              "schema": {
                "$ref": "#/components/schemas/sensorReading"
              }
            },
            "text/xml": {
              "schema": {
                "$ref": "#/components/schemas/sensorReading"
              }
            }
          },
          "description": "Body (JSON)"
        },
        "responses": {
          "200": {
            "description": "Body (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/sensorReading"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/sensorReading"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/sensorReading"
                }
              },
              "application/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/sensorReading"
                }
              },
              "text/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/sensorReading"
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/devices/{id}/notificationTriggers/{fk}": {
      "get": {
        "tags": [
          "device"
        ],
        "summary": "Find a related item by id for notificationTriggers.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          },
          {
            "name": "fk",
            "in": "path",
            "description": "Foreign key for notificationTriggers",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Body (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/notificationTrigger"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/notificationTrigger"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/notificationTrigger"
                }
              },
              "application/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/notificationTrigger"
                }
              },
              "text/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/notificationTrigger"
                }
              }
            }
          }
        },
        "deprecated": false
      },
      "delete": {
        "tags": [
          "device"
        ],
        "summary": "Remove alert/notification trigger by id {fk} for device",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          },
          {
            "name": "fk",
            "in": "path",
            "description": "Foreign key for notificationTriggers",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Request was successful"
          }
        },
        "deprecated": false
      },
      "put": {
        "tags": [
          "device"
        ],
        "summary": "Update an alert/notification trigger by id {fk} for device",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          },
          {
            "name": "fk",
            "in": "path",
            "description": "Foreign key for notificationTriggers",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/notificationTrigger"
        },
        "responses": {
          "200": {
            "description": "Body (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/notificationTrigger"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/notificationTrigger"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/notificationTrigger"
                }
              },
              "application/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/notificationTrigger"
                }
              },
              "text/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/notificationTrigger"
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/devices/{id}/transients/{fk}": {
      "get": {
        "tags": [
          "device"
        ],
        "summary": "Find a related item by id for transients.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          },
          {
            "name": "fk",
            "in": "path",
            "description": "Foreign key for transients",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Body (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/deviceTransient"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/deviceTransient"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/deviceTransient"
                }
              },
              "application/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/deviceTransient"
                }
              },
              "text/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/deviceTransient"
                }
              }
            }
          }
        },
        "deprecated": false
      },
      "delete": {
        "tags": [
          "device"
        ],
        "summary": "Delete a related item by id for transients.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          },
          {
            "name": "fk",
            "in": "path",
            "description": "Foreign key for transients",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Request was successful"
          }
        },
        "deprecated": false
      },
      "put": {
        "tags": [
          "device"
        ],
        "summary": "Update a related item by id for transients.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          },
          {
            "name": "fk",
            "in": "path",
            "description": "Foreign key for transients",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/deviceTransient"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/deviceTransient"
              }
            },
            "application/xml": {
              "schema": {
                "$ref": "#/components/schemas/deviceTransient"
              }
            },
            "text/xml": {
              "schema": {
                "$ref": "#/components/schemas/deviceTransient"
              }
            }
          },
          "description": "Body (JSON)"
        },
        "responses": {
          "200": {
            "description": "Body (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/deviceTransient"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/deviceTransient"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/deviceTransient"
                }
              },
              "application/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/deviceTransient"
                }
              },
              "text/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/deviceTransient"
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/devices/{id}/points": {
      "get": {
        "tags": [
          "device"
        ],
        "summary": "Retrieve points for a device",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          },
          {
            "name": "filter",
            "description": "JSON Filter object",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request was successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/datapoint"
                  }
                }
              },
              "application/xml": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/datapoint"
                  }
                }
              },
              "text/xml": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/datapoint"
                  }
                }
              },
              "application/javascript": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/datapoint"
                  }
                }
              },
              "text/javascript": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/datapoint"
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/devices/{id}/messages": {
      "get": {
        "tags": [
          "device"
        ],
        "summary": "Queries messages of device.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          },
          {
            "name": "filter",
            "description": "JSON Filter object",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request was successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/deviceMessage"
                  }
                }
              },
              "application/xml": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/deviceMessage"
                  }
                }
              },
              "text/xml": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/deviceMessage"
                  }
                }
              },
              "application/javascript": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/deviceMessage"
                  }
                }
              },
              "text/javascript": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/deviceMessage"
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      },
      "post": {
        "tags": [
          "device"
        ],
        "summary": "Creates a new instance in messages of this model.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/deviceMessage"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/deviceMessage"
              }
            },
            "application/xml": {
              "schema": {
                "$ref": "#/components/schemas/deviceMessage"
              }
            },
            "text/xml": {
              "schema": {
                "$ref": "#/components/schemas/deviceMessage"
              }
            }
          },
          "description": "Body (JSON)"
        },
        "responses": {
          "200": {
            "description": "Body (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/deviceMessage"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/deviceMessage"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/deviceMessage"
                }
              },
              "application/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/deviceMessage"
                }
              },
              "text/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/deviceMessage"
                }
              }
            }
          }
        },
        "deprecated": false
      },
      "delete": {
        "tags": [
          "device"
        ],
        "summary": "Deletes all messages of this model.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Request was successful"
          }
        },
        "deprecated": false
      }
    },
    "/devices/{id}/readings": {
      "get": {
        "tags": [
          "device"
        ],
        "summary": "Retrieve readings for a device",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          },
          {
            "name": "filter",
            "description": "JSON Filter object",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request was successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/sensorReading"
                  }
                }
              },
              "application/xml": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/sensorReading"
                  }
                }
              },
              "text/xml": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/sensorReading"
                  }
                }
              },
              "application/javascript": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/sensorReading"
                  }
                }
              },
              "text/javascript": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/sensorReading"
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/devices/{id}/notificationTriggers": {
      "get": {
        "tags": [
          "device"
        ],
        "summary": "Get alerts for device",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          },
          {
            "name": "filter",
            "description": "JSON Filter object",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request was successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/notificationTrigger"
                  }
                }
              },
              "application/xml": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/notificationTrigger"
                  }
                }
              },
              "text/xml": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/notificationTrigger"
                  }
                }
              },
              "application/javascript": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/notificationTrigger"
                  }
                }
              },
              "text/javascript": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/notificationTrigger"
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      },
      "post": {
        "tags": [
          "device"
        ],
        "summary": "Create alert/notification trigger for device",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/notificationTrigger"
        },
        "responses": {
          "200": {
            "description": "Body (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/notificationTrigger"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/notificationTrigger"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/notificationTrigger"
                }
              },
              "application/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/notificationTrigger"
                }
              },
              "text/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/notificationTrigger"
                }
              }
            }
          }
        },
        "deprecated": false
      },
      "delete": {
        "tags": [
          "device"
        ],
        "summary": "Remove all alert/notification trigger for device",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Request was successful"
          }
        },
        "deprecated": false
      }
    },
    "/devices/{id}/transients": {
      "get": {
        "tags": [
          "device"
        ],
        "summary": "Queries transients of device.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          },
          {
            "name": "filter",
            "description": "JSON Filter object",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request was successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/deviceTransient"
                  }
                }
              },
              "application/xml": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/deviceTransient"
                  }
                }
              },
              "text/xml": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/deviceTransient"
                  }
                }
              },
              "application/javascript": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/deviceTransient"
                  }
                }
              },
              "text/javascript": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/deviceTransient"
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/devices/{id}": {
      "get": {
        "tags": [
          "device"
        ],
        "summary": "Find a model instance by {{id}} from the data source.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Model id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          },
          {
            "name": "filter",
            "description": "Filter defining fields and include - must be a JSON-encoded string ({\"something\":\"value\"})",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Body (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/device"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/device"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/device"
                }
              },
              "application/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/device"
                }
              },
              "text/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/device"
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/devices/{id}/getRtkStatus": {
      "get": {
        "tags": [
          "device"
        ],
        "summary": "RTK>Retrieve rtk status and config object for a device",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Body (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkDevice"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkDevice"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkDevice"
                }
              },
              "application/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkDevice"
                }
              },
              "text/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkDevice"
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/devices/{id}/getRecentRtkLogs": {
      "get": {
        "tags": [
          "device"
        ],
        "summary": "RTK>Get recent log events from rtk service",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request was successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/iRtkLog"
                  }
                }
              },
              "application/xml": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/iRtkLog"
                  }
                }
              },
              "text/xml": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/iRtkLog"
                  }
                }
              },
              "application/javascript": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/iRtkLog"
                  }
                }
              },
              "text/javascript": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/iRtkLog"
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/devices/{id}/getRtkCommand": {
      "get": {
        "tags": [
          "device"
        ],
        "summary": "RTK>Retrieve a command by messageId to check status",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          },
          {
            "name": "messageId",
            "in": "query",
            "description": "messageId of the command to retrieve",
            "required": true,
            "schema": {
              "type": "number",
              "format": ""
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Body (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkCommand"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkCommand"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkCommand"
                }
              },
              "application/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkCommand"
                }
              },
              "text/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkCommand"
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/devices/{id}/queueRtkCmd_UpdateRateMs": {
      "get": {
        "tags": [
          "device"
        ],
        "summary": "RTK>Change the update interval",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          },
          {
            "name": "intervalMs",
            "in": "query",
            "description": "eg 100ms = 10Hz (max). 1000 = 1Hz. 0 = disable. Settings are not persisted across reboots, so you may want to queue always when receiving \"connected\" event for a device",
            "required": true,
            "schema": {
              "type": "number",
              "format": ""
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Body (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkCommand"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkCommand"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkCommand"
                }
              },
              "application/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkCommand"
                }
              },
              "text/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkCommand"
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/devices/{id}/queueRtkCmd_AlertNow": {
      "get": {
        "tags": [
          "device"
        ],
        "summary": "RTK>Trigger an alert now on the device",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          },
          {
            "name": "alertValue",
            "in": "query",
            "description": "Refer to documentation for structure of 4 byte alert value",
            "required": true,
            "schema": {
              "type": "number",
              "format": ""
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Body (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkCommand"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkCommand"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkCommand"
                }
              },
              "application/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkCommand"
                }
              },
              "text/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkCommand"
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/devices/{id}/queueRtkCmd_AlertWithPrompt": {
      "get": {
        "tags": [
          "device"
        ],
        "summary": "RTK>Trigger a prompt now on the device (response sent via MQTT)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          },
          {
            "name": "alertValue",
            "in": "query",
            "description": "Refer to documentation for structure of 4 byte alert value",
            "required": true,
            "schema": {
              "type": "number",
              "format": ""
            }
          },
          {
            "name": "prompt",
            "in": "query",
            "description": "Text to display on device. Long text will be scrolled automatically but try to keep it short!",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "btn1Text",
            "in": "query",
            "description": "Text to display above left(up) arrow button",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "btn2Text",
            "in": "query",
            "description": "Text to display above right(down) arrow button",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "timeoutS",
            "in": "query",
            "description": "if non-zero, auto hide message after this many seconds",
            "required": false,
            "schema": {
              "type": "number",
              "format": ""
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Body (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkCommand"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkCommand"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkCommand"
                }
              },
              "application/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkCommand"
                }
              },
              "text/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkCommand"
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/devices/{id}/queueRtkCmd_RebootRtk": {
      "get": {
        "tags": [
          "device"
        ],
        "summary": "RTK>Reboot Rtk Module (useful for fixing multipath hysteresis issues)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Body (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkCommand"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkCommand"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkCommand"
                }
              },
              "application/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkCommand"
                }
              },
              "text/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkCommand"
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/devices/{id}/queueRtkCmd_SetPointBufferSize": {
      "get": {
        "tags": [
          "device"
        ],
        "summary": "RTK>Set point buffer size",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          },
          {
            "name": "maxPoints",
            "in": "query",
            "description": "min=1, max=1000(default). 250 recommended for poor network areas. Settings are not persisted across reboots, so you may want to queue cmd always when receiving \"connected\" event for a device",
            "required": true,
            "schema": {
              "type": "number",
              "format": ""
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Body (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkCommand"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkCommand"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkCommand"
                }
              },
              "application/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkCommand"
                }
              },
              "text/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkCommand"
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/devices/{id}/updateRtkBaseStatus": {
      "get": {
        "tags": [
          "device"
        ],
        "summary": "RTK>External BaseStation Status Change",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          },
          {
            "name": "online",
            "in": "query",
            "description": "If the external base is online. If true, the other parameters are required",
            "required": true,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "lat",
            "in": "query",
            "description": "Latitude of the external base",
            "required": false,
            "schema": {
              "type": "number",
              "format": ""
            }
          },
          {
            "name": "lng",
            "in": "query",
            "description": "Longitude of the external base",
            "required": false,
            "schema": {
              "type": "number",
              "format": ""
            }
          },
          {
            "name": "alt",
            "in": "query",
            "description": "Altitude of the external base",
            "required": false,
            "schema": {
              "type": "number",
              "format": ""
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Body (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkBase"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkBase"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkBase"
                }
              },
              "application/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkBase"
                }
              },
              "text/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/iRtkBase"
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/devices/{id}/flightMode": {
      "get": {
        "tags": [
          "device"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          },
          {
            "name": "duration",
            "in": "query",
            "description": "How long to go into flightMode, in minutes",
            "required": true,
            "schema": {
              "type": "number",
              "format": ""
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request was successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              },
              "application/xml": {
                "schema": {
                  "type": "object"
                }
              },
              "text/xml": {
                "schema": {
                  "type": "object"
                }
              },
              "application/javascript": {
                "schema": {
                  "type": "object"
                }
              },
              "text/javascript": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/devices/{id}/setSafeZone": {
      "post": {
        "tags": [
          "device"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/GeoPoint"
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/GeoPoint"
                }
              }
            },
            "application/xml": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/GeoPoint"
                }
              }
            },
            "text/xml": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/GeoPoint"
                }
              }
            }
          },
          "description": "Array of {lat:x,lng:y} points denoting the vertices of the safe-zone",
          "required": true
        },
        "responses": {
          "200": {
            "description": "Body (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/geofence"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/geofence"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/geofence"
                }
              },
              "application/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/geofence"
                }
              },
              "text/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/geofence"
                }
              }
            }
          }
        },
        "deprecated": false,
        "summary": "Update safe-zone for device"
      }
    },
    "/devices/{id}/getSafeZone": {
      "get": {
        "tags": [
          "device"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Body (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/geofence"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/geofence"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/geofence"
                }
              },
              "application/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/geofence"
                }
              },
              "text/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/geofence"
                }
              }
            }
          }
        },
        "deprecated": false,
        "summary": "Get safe-zone for device"
      }
    },
    "/devices/changeTags": {
      "post": {
        "tags": [
          "device"
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "ids": {
                    "type": "string",
                    "format": "JSON"
                  },
                  "tagEdits": {
                    "type": "string",
                    "format": "JSON"
                  }
                },
                "required": [
                  "ids",
                  "tagEdits"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Request was successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  }
                }
              },
              "application/xml": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  }
                }
              },
              "text/xml": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  }
                }
              },
              "application/javascript": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  }
                }
              },
              "text/javascript": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/devices/{id}/deactivate": {
      "get": {
        "tags": [
          "device"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request was successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "string"
                    }
                  }
                }
              },
              "application/xml": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "string"
                    }
                  }
                }
              },
              "text/xml": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "string"
                    }
                  }
                }
              },
              "application/javascript": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "string"
                    }
                  }
                }
              },
              "text/javascript": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/devices/{id}/nearbyDevices": {
      "get": {
        "tags": [
          "device"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          },
          {
            "name": "dateRange",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          },
          {
            "name": "correlationId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request was successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/x-any"
                  }
                }
              },
              "application/xml": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/x-any"
                  }
                }
              },
              "text/xml": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/x-any"
                  }
                }
              },
              "application/javascript": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/x-any"
                  }
                }
              },
              "text/javascript": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/x-any"
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/devices/{id}/nearbyDeviceData": {
      "get": {
        "tags": [
          "device"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          },
          {
            "name": "nearbyId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          },
          {
            "name": "dateRange",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request was successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              },
              "application/xml": {
                "schema": {
                  "type": "object"
                }
              },
              "text/xml": {
                "schema": {
                  "type": "object"
                }
              },
              "application/javascript": {
                "schema": {
                  "type": "object"
                }
              },
              "text/javascript": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/devices/{id}/setupSqsForwarding": {
      "get": {
        "tags": [
          "device"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          },
          {
            "name": "sqsArn",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "types",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request was successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  }
                }
              },
              "application/xml": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  }
                }
              },
              "text/xml": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  }
                }
              },
              "application/javascript": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  }
                }
              },
              "text/javascript": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/devices/{id}/setMetaItem": {
      "get": {
        "tags": [
          "device"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          },
          {
            "name": "key",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "value",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request was successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  }
                }
              },
              "application/xml": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  }
                }
              },
              "text/xml": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  }
                }
              },
              "application/javascript": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  }
                }
              },
              "text/javascript": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/devices/{id}/setNtripSettings": {
      "get": {
        "tags": [
          "device"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "device id",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          },
          {
            "name": "settings",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request was successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              },
              "application/xml": {
                "schema": {
                  "type": "string"
                }
              },
              "text/xml": {
                "schema": {
                  "type": "string"
                }
              },
              "application/javascript": {
                "schema": {
                  "type": "string"
                }
              },
              "text/javascript": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/users/{id}/geofences/{fk}": {
      "get": {
        "tags": [
          "user"
        ],
        "summary": "Find a related item by id for geofences.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "user id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          },
          {
            "name": "fk",
            "in": "path",
            "description": "Foreign key for geofences",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Body (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/geofence"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/geofence"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/geofence"
                }
              },
              "application/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/geofence"
                }
              },
              "text/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/geofence"
                }
              }
            }
          }
        },
        "deprecated": false
      },
      "delete": {
        "tags": [
          "user"
        ],
        "summary": "Delete a related item by id for geofences.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "user id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          },
          {
            "name": "fk",
            "in": "path",
            "description": "Foreign key for geofences",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Request was successful"
          }
        },
        "deprecated": false
      },
      "put": {
        "tags": [
          "user"
        ],
        "summary": "Update a related item by id for geofences.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "user id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          },
          {
            "name": "fk",
            "in": "path",
            "description": "Foreign key for geofences",
            "required": true,
            "schema": {
              "type": "number",
              "format": "integer"
            }
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/geofence"
        },
        "responses": {
          "200": {
            "description": "Body (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/geofence"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/geofence"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/geofence"
                }
              },
              "application/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/geofence"
                }
              },
              "text/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/geofence"
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/users/{id}/devices": {
      "get": {
        "tags": [
          "user"
        ],
        "summary": "Queries devices of user.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "user id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          },
          {
            "name": "filter",
            "description": "JSON Filter object",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request was successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/device"
                  }
                }
              },
              "application/xml": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/device"
                  }
                }
              },
              "text/xml": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/device"
                  }
                }
              },
              "application/javascript": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/device"
                  }
                }
              },
              "text/javascript": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/device"
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/users/{id}/geofences": {
      "get": {
        "tags": [
          "user"
        ],
        "summary": "Queries geofences of user.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "user id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          },
          {
            "name": "filter",
            "description": "JSON Filter object",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request was successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/geofence"
                  }
                }
              },
              "application/xml": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/geofence"
                  }
                }
              },
              "text/xml": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/geofence"
                  }
                }
              },
              "application/javascript": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/geofence"
                  }
                }
              },
              "text/javascript": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/geofence"
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      },
      "post": {
        "tags": [
          "user"
        ],
        "summary": "Creates a new instance in geofences of this model.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "user id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/geofence"
        },
        "responses": {
          "200": {
            "description": "Body (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/geofence"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/geofence"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/geofence"
                }
              },
              "application/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/geofence"
                }
              },
              "text/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/geofence"
                }
              }
            }
          }
        },
        "deprecated": false
      },
      "delete": {
        "tags": [
          "user"
        ],
        "summary": "Deletes all geofences of this model.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "user id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Request was successful"
          }
        },
        "deprecated": false
      }
    },
    "/users/login": {
      "post": {
        "tags": [
          "user"
        ],
        "summary": "Login a user with username/email and password.",
        "parameters": [
          {
            "name": "include",
            "in": "query",
            "description": "Related objects to include in the response. See the description of return value for more details.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/credentials"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/credentials"
              }
            },
            "application/xml": {
              "schema": {
                "$ref": "#/components/schemas/credentials"
              }
            },
            "text/xml": {
              "schema": {
                "$ref": "#/components/schemas/credentials"
              }
            }
          },
          "description": "Body (JSON)",
          "required": true
        },
        "responses": {
          "200": {
            "description": "Body (JSON)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/accessToken"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/accessToken"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/accessToken"
                }
              },
              "application/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/accessToken"
                }
              },
              "text/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/accessToken"
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/users/{id}/getDeviceSummary": {
      "get": {
        "tags": [
          "user"
        ],
        "summary": "Retrieve a summary of all devices on this user account.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "user id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          },
          {
            "name": "pointCount",
            "in": "query",
            "description": "Maximum number of points to return per device. Default 5.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          },
          {
            "name": "dateRange",
            "in": "query",
            "description": "What date range to consider when retrieving recent points. Typical use is [TimeOfLastPointDownload, NOW]. Defaults to all time.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          },
          {
            "name": "hideApprox",
            "in": "query",
            "description": "Don't include GSM / poor accuracy locations. Default to false.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request was successful",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Returns Array of device objects, with extra field `latestPoints`, containing an array of simplified datapoint objects. Datapoint fields included are 'id', 'timestamp', 'location', 'speed', 'course', 'accuracy', 'sendReason', 'address', 'deviceId', 'alertType'",
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/x-any"
                  }
                }
              },
              "application/xml": {
                "schema": {
                  "description": "Returns Array of device objects, with extra field `latestPoints`, containing an array of simplified datapoint objects. Datapoint fields included are 'id', 'timestamp', 'location', 'speed', 'course', 'accuracy', 'sendReason', 'address', 'deviceId', 'alertType'",
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/x-any"
                  }
                }
              },
              "text/xml": {
                "schema": {
                  "description": "Returns Array of device objects, with extra field `latestPoints`, containing an array of simplified datapoint objects. Datapoint fields included are 'id', 'timestamp', 'location', 'speed', 'course', 'accuracy', 'sendReason', 'address', 'deviceId', 'alertType'",
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/x-any"
                  }
                }
              },
              "application/javascript": {
                "schema": {
                  "description": "Returns Array of device objects, with extra field `latestPoints`, containing an array of simplified datapoint objects. Datapoint fields included are 'id', 'timestamp', 'location', 'speed', 'course', 'accuracy', 'sendReason', 'address', 'deviceId', 'alertType'",
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/x-any"
                  }
                }
              },
              "text/javascript": {
                "schema": {
                  "description": "Returns Array of device objects, with extra field `latestPoints`, containing an array of simplified datapoint objects. Datapoint fields included are 'id', 'timestamp', 'location', 'speed', 'course', 'accuracy', 'sendReason', 'address', 'deviceId', 'alertType'",
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/x-any"
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/users/{id}/getDevicesInZone": {
      "get": {
        "tags": [
          "user"
        ],
        "summary": "Retrieve a list of devices in any given zone or group of zones.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "user id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          },
          {
            "name": "zoneId",
            "in": "query",
            "description": "ID of geofence to search. zoneId or zoneType required.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          },
          {
            "name": "zoneType",
            "in": "query",
            "description": "Type of zones to search. Ignored if zoneId is specified. zoneId or zoneType required.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          },
          {
            "name": "includeApprox",
            "in": "query",
            "description": "Include GSM / poor accuracy locations. Default to false.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request was successful",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Returns Array of device objects, with extra field `latestPoints`, containing an array of simplified datapoint objects. Datapoint fields included are 'id', 'timestamp', 'location', 'speed', 'course', 'accuracy', 'sendReason', 'address', 'deviceId', 'alertType'",
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/x-any"
                  }
                }
              },
              "application/xml": {
                "schema": {
                  "description": "Returns Array of device objects, with extra field `latestPoints`, containing an array of simplified datapoint objects. Datapoint fields included are 'id', 'timestamp', 'location', 'speed', 'course', 'accuracy', 'sendReason', 'address', 'deviceId', 'alertType'",
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/x-any"
                  }
                }
              },
              "text/xml": {
                "schema": {
                  "description": "Returns Array of device objects, with extra field `latestPoints`, containing an array of simplified datapoint objects. Datapoint fields included are 'id', 'timestamp', 'location', 'speed', 'course', 'accuracy', 'sendReason', 'address', 'deviceId', 'alertType'",
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/x-any"
                  }
                }
              },
              "application/javascript": {
                "schema": {
                  "description": "Returns Array of device objects, with extra field `latestPoints`, containing an array of simplified datapoint objects. Datapoint fields included are 'id', 'timestamp', 'location', 'speed', 'course', 'accuracy', 'sendReason', 'address', 'deviceId', 'alertType'",
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/x-any"
                  }
                }
              },
              "text/javascript": {
                "schema": {
                  "description": "Returns Array of device objects, with extra field `latestPoints`, containing an array of simplified datapoint objects. Datapoint fields included are 'id', 'timestamp', 'location', 'speed', 'course', 'accuracy', 'sendReason', 'address', 'deviceId', 'alertType'",
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/x-any"
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/users/{id}/getDevicesByTag": {
      "get": {
        "tags": [
          "user"
        ],
        "summary": "Retrieve a list of devices matching a given tag.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "user id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          },
          {
            "name": "tag",
            "in": "query",
            "description": "Tag to search for in fully qualified key:value format. Example device_type:truck. Partial searches with wildcards may be used, eg device_type:% or device_type:veh_%",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "Optional array of device model fields to return. eg [\"id\",\"name\"]",
            "required": false,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request was successful",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Returns Array of device objects",
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/x-any"
                  }
                }
              },
              "application/xml": {
                "schema": {
                  "description": "Returns Array of device objects",
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/x-any"
                  }
                }
              },
              "text/xml": {
                "schema": {
                  "description": "Returns Array of device objects",
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/x-any"
                  }
                }
              },
              "application/javascript": {
                "schema": {
                  "description": "Returns Array of device objects",
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/x-any"
                  }
                }
              },
              "text/javascript": {
                "schema": {
                  "description": "Returns Array of device objects",
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/x-any"
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/users/{id}/getRecentActivity": {
      "get": {
        "tags": [
          "user"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "user id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          },
          {
            "name": "dateRange",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "JSON"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request was successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/x-any"
                  }
                }
              },
              "application/xml": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/x-any"
                  }
                }
              },
              "text/xml": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/x-any"
                  }
                }
              },
              "application/javascript": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/x-any"
                  }
                }
              },
              "text/javascript": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/x-any"
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/reports/vehicle-summary": {
      "post": {
        "tags": [
          "report"
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/postReportsVehicleSummary"
        },
        "responses": {
          "200": {
            "description": "Request was successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              },
              "application/xml": {
                "schema": {
                  "type": "object"
                }
              },
              "text/xml": {
                "schema": {
                  "type": "object"
                }
              },
              "application/javascript": {
                "schema": {
                  "type": "object"
                }
              },
              "text/javascript": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/reports/activity": {
      "post": {
        "tags": [
          "report"
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/postReportsVehicleSummary"
        },
        "responses": {
          "200": {
            "description": "Request was successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              },
              "application/xml": {
                "schema": {
                  "type": "object"
                }
              },
              "text/xml": {
                "schema": {
                  "type": "object"
                }
              },
              "application/javascript": {
                "schema": {
                  "type": "object"
                }
              },
              "text/javascript": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "tags": [
    {
      "name": "device"
    }
  ],
  "servers": [
    {
      "url": "https://api.lightbug.cloud/api"
    }
  ],
  "components": {
    "requestBodies": {
      "notificationTrigger": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/notificationTrigger"
            }
          },
          "application/x-www-form-urlencoded": {
            "schema": {
              "$ref": "#/components/schemas/notificationTrigger"
            }
          },
          "application/xml": {
            "schema": {
              "$ref": "#/components/schemas/notificationTrigger"
            }
          },
          "text/xml": {
            "schema": {
              "$ref": "#/components/schemas/notificationTrigger"
            }
          }
        },
        "description": "Body (JSON)"
      },
      "geofence": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/geofence"
            }
          },
          "application/x-www-form-urlencoded": {
            "schema": {
              "$ref": "#/components/schemas/geofence"
            }
          },
          "application/xml": {
            "schema": {
              "$ref": "#/components/schemas/geofence"
            }
          },
          "text/xml": {
            "schema": {
              "$ref": "#/components/schemas/geofence"
            }
          }
        },
        "description": "Body (JSON)"
      },
      "postReportsVehicleSummary": {
        "content": {
          "application/x-www-form-urlencoded": {
            "schema": {
              "type": "object",
              "properties": {
                "deviceId": {
                  "description": "The device id to get the data for",
                  "type": "number",
                  "format": ""
                },
                "dateRange": {
                  "description": "The date range to get the data for, in epoch milliseconds, [start, end]",
                  "type": "string",
                  "format": "JSON"
                },
                "parameters": {
                  "description": "Optional parameters, as JSON object, use the APP and developer console to see the options",
                  "type": "string",
                  "format": "JSON"
                }
              },
              "required": [
                "deviceId",
                "dateRange"
              ]
            }
          }
        },
        "required": true
      }
    },
    "schemas": {
      "x-any": {
        "properties": {}
      },
      "datapoint": {
        "properties": {
          "location": {
            "$ref": "#/components/schemas/GeoPoint"
          },
          "timestamp": {
            "description": "Timestamp for the datapoint. NB this is not necessarily the same as 'created'",
            "type": "string",
            "format": "date-time"
          },
          "speed": {
            "description": "Ground velocity in kmh, as determined by the GPS",
            "type": "number",
            "format": ""
          },
          "altitude": {
            "description": "Altitude in m, as determined by the GPS",
            "type": "number",
            "format": ""
          },
          "course": {
            "description": "Course in degrees, as determined by the GPS",
            "type": "number",
            "format": ""
          },
          "num_value": {
            "description": "Internal use only",
            "type": "string"
          },
          "stringValue": {
            "description": "Internal use only",
            "type": "string"
          },
          "sendReason": {
            "description": "Bitfield indicating reason for datapoint transmission and status of the device at the time.\n\r\nBit1(1): Wake mode active, \n\r\nBit2(2): Sleep mode active, \n\r\nBit3(4): Bluetooth disconnected, \n\r\nBit4(8): Outside of Safe-zone, \n\r\nBit5(16): Motion detected, \n\r\nBit6(32): Device started moving, \n\r\nBit7(64): Device stopped moving, \n\r\nBit8(128): Position is stale: last known location was used\n\r\nSpecial case 255/0xFF: device was checking in with server. Ignore all data",
            "type": "number",
            "format": ""
          },
          "sats": {
            "description": "Number of visible satellites, as determined by the GPS",
            "type": "number",
            "format": ""
          },
          "hdop": {
            "description": "Deprecated",
            "type": "number",
            "format": ""
          },
          "accuracy": {
            "description": "Accuracy of the location in meters",
            "type": "number",
            "format": ""
          },
          "locationType": {
            "default": "gps",
            "description": "Type of position. Can be 'gps', 'wifi', 'gsm' or 'invalid'",
            "type": "string"
          },
          "batteryVoltage": {
            "description": "Battery charge level in volts.",
            "type": "number",
            "format": ""
          },
          "batteryPct": {
            "description": "Battery charge level in %.",
            "type": "number",
            "format": ""
          },
          "averageCharge": {
            "description": "Internal Use. 255 indicates plugged in and charging.",
            "type": "number",
            "format": ""
          },
          "created": {
            "description": "Timestamp for when the datapoint was received and processed by the server",
            "type": "string",
            "format": "date-time"
          },
          "address": {
            "description": "A reverse geocode result for the point",
            "type": "string"
          },
          "alertType": {
            "description": "Bitfield indicating what alerts where active at transmission time\n\r\nBit1(1): Freefall / Drop detected, \n\r\nBit2(2): Rotation detected, \n\r\nBit3(4): GSM jamming detected, \n\r\nBit4(8): Button was pressed, \n\r\nBit5(16): Generic Alert ",
            "type": "number",
            "format": ""
          },
          "currentUsed": {
            "description": "Current Used to send this location in microAmp Hours",
            "type": "number",
            "format": ""
          },
          "gsmSignal": {
            "description": "GSM CSQ value",
            "type": "number",
            "format": ""
          },
          "correlationId": {
            "description": "Internal use - correlation identifier",
            "type": "string"
          },
          "id": {
            "type": "number",
            "format": ""
          },
          "deviceId": {
            "type": "number",
            "format": ""
          }
        },
        "required": [
          "timestamp",
          "locationType",
          "created"
        ]
      },
      "deviceConfig": {
        "properties": {
          "currentFW": {
            "description": "Current Firmware version",
            "type": "string"
          },
          "otaFW": {
            "description": "Pending Firmware version. If non null, the unit will be told to upgrade to\nthis version when it next transmits in sleep mode.",
            "type": "string"
          },
          "interval": {
            "default": 300,
            "description": "The wake mode interval in seconds. The unit will connect to the server this often when awake.",
            "type": "number",
            "format": ""
          },
          "sleepInterval": {
            "default": 43200,
            "description": "Sleep mode interval in seconds. The unit will try to connect this often to the server when asleep",
            "type": "number",
            "format": ""
          },
          "packing": {
            "default": 1,
            "description": "The number of GPS points to send with each transmission. A packing setting of 3 with an 'interval'\nof 60s will result in points recorded approximately every 20s, but they will only be sent together.\nThis increases the time you have to wait for locations to come through to the server but improves battery life",
            "type": "number",
            "format": ""
          },
          "movementSensitivity": {
            "default": 1,
            "description": "Deprecated. See debounce.",
            "type": "number",
            "format": ""
          },
          "debounce": {
            "default": 3,
            "description": "Movement sensitivity on a scale of 1 to 10, with 1 being the most sensitive. It is correlated to the\nnumber of consecutive milliseconds the acceleration needs to exceed the movementSensitivity threshold",
            "type": "number",
            "format": ""
          },
          "movementSensitivity2": {
            "default": 2,
            "description": "A secondary debounce value. Typically this value is lower or equal to debounce, representing increased\nsensitivity to movement once the device is already moving.",
            "type": "number",
            "format": ""
          },
          "behavior": {
            "default": 0,
            "description": "Char Bitfield with various flags. Advanced use only. \nDisableBluetooth:32 | \nEncrypt:128 | \nGsmOnWhenAwake:1 | \nGsmOnWhenAsleep:2 | \nGpsOnWhenAwake:4 | \nDisableWifiAccuracyAssist:8 | \nRepeatSleep:16 | \nDisableWifi:64",
            "type": "number",
            "format": ""
          },
          "modeControl": {
            "default": 0,
            "description": "Char Bitfield with various flags. Advanced use only. \nStartStopOnly:1 | \nLockAwakeOnAlert:2 | \nSendSleepLocAfterBtDisconnect:4 | ",
            "type": "number",
            "format": ""
          },
          "modeControl2": {
            "default": 0,
            "description": "Char Bitfield with various flags. Advanced use only. FW >= 69. \nSendStopImmediately:1 | \nStopTimeoutIsInMinutes:2 | \nHarshPowerBudget:4 | \nLock2G: 8",
            "type": "number",
            "format": ""
          },
          "gpsTimeout": {
            "default": 90,
            "description": "How long to let the GPS searches for a lock in seconds before giving up. Max 255s.",
            "type": "number",
            "format": ""
          },
          "transmitTimeout": {
            "default": 0,
            "description": "When the unit first wakes up from sleep, how long to wait before trying to transmit in multiples of 30 seconds. 0 = instant, 1 = 30s, 2 = 60s...\n\r\nUseful to avoid detection or draining battery inside shielded buildings.",
            "type": "number",
            "format": ""
          },
          "gpsStabilize": {
            "default": 10,
            "description": "How long to let the GPS stabilise in seconds once a lock is achieved before sending the position. Higher values may increase accuracy.",
            "type": "number",
            "format": ""
          },
          "gpsCheckInterval": {
            "default": 120,
            "description": "If a safe-zone is used, how often to check the wifi & gps to see if its still inside it (only applies when motion is detected)",
            "type": "number",
            "format": ""
          },
          "stopTimeout": {
            "default": 90,
            "description": "The total amount of time in seconds the unit has to be stationary for before deeming the journey over and switching to sleep mode",
            "type": "number",
            "format": ""
          },
          "tolerancePercentage": {
            "default": 10,
            "description": "Power budget in mAh per location update. Default 10, do not set lower than 5.",
            "type": "number",
            "format": ""
          },
          "reasonsToWake": {
            "default": [
              {
                "bluetooth": false,
                "move": true,
                "geofence": false
              }
            ],
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "modified": {
            "description": "Set to any non null date to indicate the configuration should be pushed to the device when it next connects",
            "type": "string",
            "format": "date-time"
          },
          "forceFw": {
            "default": false,
            "description": "Internal use.\n\r\nUsed with otaFW. Set to true to force the unit to upgrade on next connection (rather than waiting\nfor a sleep connection",
            "type": "boolean"
          },
          "updateAvailibility": {
            "default": 0,
            "description": "Internal use. Set to true to indicate an update is available",
            "type": "number",
            "format": ""
          },
          "receivedAt": {
            "description": "Indicates the last time the settings were sent to the device",
            "type": "string",
            "format": "date-time"
          },
          "reset": {
            "description": "Non NULL values cause unit to restart on next connection\n\r\n0 = Normal reboot\n\r\n1 = Clear settings cache and restart\n\r\n2 = Clear cache and bluetooth connection data, then restart",
            "type": "number",
            "format": ""
          },
          "flashTryCount": {
            "default": 0,
            "description": "Internal use. Set to 0 when changing otaFW",
            "type": "number",
            "format": ""
          },
          "homeWifiNetwork": {
            "maxLength": 127,
            "description": "WiFi network name to use as a Safe-zone. When this network is visible, stay asleep",
            "type": "string"
          },
          "wakeAction": {
            "default": "normal",
            "description": "Internal Use Only. What to do when the unit wakes up (ie is moved and not in a safe-zone). Options are 'available'\n(lost and found), and 'normal' (tracking)",
            "type": "string"
          },
          "alertAction": {
            "default": "nothing",
            "description": "What to do when the button is pressed or the unit is dropped. Options are\n'available' (stay registered on the mobile network),\n'nothing' (one transmission) and \n'lockOn' (keep transmitting at 'interval' until instructed otherwise",
            "type": "string"
          },
          "timed": {
            "description": "Timed update settings. Must be array of objects matching [{hh: number, mm: number, day: number, action: number}, ...] format",
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "command": {
            "description": "Internal use. Sends command to device on next connection",
            "type": "number",
            "format": ""
          },
          "id": {
            "type": "number",
            "format": ""
          },
          "deviceId": {
            "type": "number",
            "format": ""
          },
          "safeZoneId": {
            "type": "number",
            "format": ""
          }
        },
        "required": [
          "interval",
          "sleepInterval",
          "packing",
          "wakeAction",
          "alertAction"
        ]
      },
      "notification": {
        "properties": {
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "params": {
            "type": "object"
          },
          "message": {
            "type": "string"
          },
          "dismissedOn": {
            "type": "string",
            "format": "date-time"
          },
          "dismissedBy": {
            "type": "object"
          },
          "id": {
            "type": "number",
            "format": ""
          },
          "deviceId": {
            "type": "number",
            "format": ""
          },
          "pointId": {
            "type": "number",
            "format": ""
          },
          "userId": {
            "type": "number",
            "format": ""
          },
          "triggerId": {
            "type": "number",
            "format": ""
          }
        },
        "required": [
          "created"
        ]
      },
      "deviceMessage": {
        "properties": {
          "config": {
            "type": "string",
            "format": "byte"
          },
          "message": {
            "type": "string"
          },
          "mobileTerminated": {
            "default": true,
            "type": "boolean"
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "sent": {
            "type": "string",
            "format": "date-time"
          },
          "id": {
            "type": "number",
            "format": ""
          },
          "deviceId": {
            "type": "number",
            "format": ""
          },
          "userId": {
            "type": "number",
            "format": ""
          }
        },
        "required": [
          "created"
        ]
      },
      "sensorReading": {
        "properties": {
          "timestamp": {
            "description": "Timestamp for the reading",
            "type": "string",
            "format": "date-time"
          },
          "created": {
            "description": "Timestamp for the writing to db",
            "type": "string",
            "format": "date-time"
          },
          "type": {
            "description": "Sensor type: 'ultra' (fill level), 'temp' (temperature), ...",
            "type": "string"
          },
          "value": {
            "description": "JSON value",
            "type": "object"
          },
          "rssi": {
            "description": "RSSI if from secondary wireless device",
            "type": "number",
            "format": ""
          },
          "meta": {
            "description": "JSON metadata",
            "type": "object"
          },
          "relatedId": {
            "description": "LoraId of another (ie for signal strength)",
            "type": "number",
            "format": ""
          },
          "correlationId": {
            "description": "Internal use - correlation identifier",
            "type": "string"
          },
          "id": {
            "type": "number",
            "format": ""
          },
          "gatewayId": {
            "type": "number",
            "format": ""
          },
          "deviceId": {
            "type": "number",
            "format": ""
          },
          "datapointId": {
            "type": "number",
            "format": ""
          }
        },
        "required": [
          "timestamp",
          "created",
          "type",
          "value"
        ]
      },
      "notificationTrigger": {
        "properties": {
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "parameters": {
            "type": "object"
          },
          "muteFor": {
            "default": 0,
            "type": "number",
            "format": ""
          },
          "lastTriggered": {
            "type": "string",
            "format": "date-time"
          },
          "delivery": {
            "default": {
              "push": true,
              "email": false
            },
            "type": "object"
          },
          "id": {
            "type": "number",
            "format": ""
          },
          "deviceId": {
            "type": "number",
            "format": ""
          },
          "userId": {
            "type": "number",
            "format": ""
          }
        },
        "required": [
          "name",
          "type",
          "muteFor",
          "delivery"
        ]
      },
      "deviceTransient": {
        "properties": {
          "type": {
            "type": "number",
            "format": ""
          },
          "duration": {
            "type": "number",
            "format": ""
          },
          "triggeredAt": {
            "type": "string",
            "format": "date-time"
          },
          "end": {
            "type": "string",
            "format": "date-time"
          },
          "sent": {
            "type": "string",
            "format": "date-time"
          },
          "sms": {
            "default": false,
            "type": "boolean"
          },
          "id": {
            "type": "number",
            "format": ""
          },
          "deviceId": {
            "type": "number",
            "format": ""
          }
        },
        "required": [
          "type",
          "duration",
          "triggeredAt"
        ]
      },
      "iRtkBase": {
        "properties": {
          "deviceId": {
            "type": "number",
            "format": ""
          },
          "type": {
            "description": "ENUM('primary', 'secondary')",
            "type": "string"
          },
          "group": {
            "type": "number",
            "format": ""
          },
          "connected": {
            "description": "Last open msg receive time from rtk base (not same as last message, use log for this)",
            "type": "string",
            "format": "date-time"
          },
          "surveyCompleted": {
            "description": "TBC",
            "type": "string",
            "format": "date-time"
          },
          "location": {
            "$ref": "#/components/schemas/GeoPoint"
          },
          "accuracy": {
            "type": "number",
            "format": ""
          },
          "status": {
            "description": "ENUM('offline', 'initializing', 'no_signal', 'online_fixed', 'online_surveyed', 'surveying')",
            "type": "string"
          },
          "fixedPositionLat": {
            "type": "number",
            "format": ""
          },
          "fixedPositionLng": {
            "type": "number",
            "format": ""
          },
          "fixedPositionAlt": {
            "type": "number",
            "format": ""
          },
          "surveyTime": {
            "type": "number",
            "format": ""
          },
          "surveyMinAcc": {
            "type": "number",
            "format": ""
          },
          "surveyRequested": {
            "type": "boolean"
          },
          "valid": {
            "type": "boolean"
          }
        },
        "required": [
          "deviceId"
        ]
      },
      "iRtkDevice": {
        "properties": {
          "deviceId": {
            "type": "number",
            "format": ""
          },
          "group": {
            "type": "number",
            "format": ""
          },
          "msgMask": {
            "type": "number",
            "format": ""
          },
          "connected": {
            "description": "Last open msg receive time from rtk base (not same as last message, use log for this)",
            "type": "string",
            "format": "date-time"
          },
          "locationUpdated": {
            "description": "TBC",
            "type": "string",
            "format": "date-time"
          },
          "location": {
            "$ref": "#/components/schemas/GeoPoint"
          },
          "accuracy": {
            "type": "number",
            "format": ""
          },
          "positionType": {
            "description": "ENUM('invalid', 'fixed', '2d', 'standalone', 'rtkFloat', 'rtkFix')",
            "type": "string"
          },
          "currentBaseId": {
            "type": "number",
            "format": ""
          }
        },
        "required": [
          "deviceId"
        ]
      },
      "iRtkLog": {
        "properties": {
          "id": {
            "type": "number",
            "format": ""
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "deviceId": {
            "type": "number",
            "format": ""
          },
          "msgType": {
            "type": "number",
            "format": ""
          },
          "baseStationId": {
            "type": "number",
            "format": ""
          },
          "locationType": {
            "description": "ENUM('invalid', 'fixed', '2d', 'standalone', 'rtkFloat', 'rtkFix')",
            "type": "string"
          },
          "accuracy": {
            "type": "number",
            "format": ""
          },
          "lat": {
            "type": "number",
            "format": ""
          },
          "lng": {
            "type": "number",
            "format": ""
          },
          "linkQuality": {
            "type": "number",
            "format": ""
          },
          "toAddress": {
            "type": "string"
          },
          "fromAddress": {
            "type": "string"
          },
          "info": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ]
      },
      "iRtkCommand": {
        "properties": {
          "deviceId": {
            "description": "DeviceId recipient",
            "type": "number",
            "format": ""
          },
          "messageId": {
            "description": "A unique (per device) message ID for the command. If not supplied, a random 32 bit integer will be assigned. Duplicate messageIds will throw an error.",
            "type": "number",
            "format": ""
          },
          "commandType": {
            "description": "Command number. Currently supported SetUpdateRate = 1,AlertNow = 2,AlertWithPrompt = 3,RestartGps = 4,SetPointBufferMaxSize = 5,PromptAction = 6",
            "type": "number",
            "format": ""
          },
          "created": {
            "description": "Auto-filled on save, when the command was created in the system",
            "type": "string",
            "format": "date-time"
          },
          "sent": {
            "description": "Set to current time when the command is sent to the device. If multiple resends without ACK, it will reflect the latest send.",
            "type": "string",
            "format": "date-time"
          },
          "receivedAck": {
            "description": "When the server received ACK from device for this messageId",
            "type": "string",
            "format": "date-time"
          },
          "payload": {
            "description": "Associated data for the command",
            "type": "string",
            "format": "byte"
          },
          "response": {
            "description": "If the device transmitted a command response with matching messageId, it will be stored here. Mostly this field will be null.",
            "type": "string",
            "format": "byte"
          },
          "id": {
            "type": "number",
            "format": ""
          }
        },
        "required": [
          "deviceId",
          "commandType",
          "created"
        ]
      },
      "device": {
        "properties": {
          "imei": {
            "maxLength": 15,
            "type": "string"
          },
          "iccid": {
            "type": "string"
          },
          "loraId": {
            "type": "number",
            "format": ""
          },
          "imsi": {
            "type": "string"
          },
          "btMac": {
            "description": "Bluetooth MAC Address as 48bit number",
            "type": "number",
            "format": ""
          },
          "btMacAddress": {
            "maxLength": 17,
            "description": "Bluetooth MAC Address in standard format",
            "type": "string"
          },
          "uwbId": {
            "description": "UWB Address as 32bit number",
            "type": "number",
            "format": ""
          },
          "serial": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "expires": {
            "type": "string",
            "format": "date-time"
          },
          "lastConnection": {
            "type": "string",
            "format": "date-time"
          },
          "firstSeen": {
            "type": "string",
            "format": "date-time"
          },
          "mode": {
            "default": "default",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "batteryVoltage": {
            "type": "number",
            "format": ""
          },
          "batteryPct": {
            "type": "number",
            "format": ""
          },
          "batteryType": {
            "default": "LIO",
            "type": "string"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "currentMode": {
            "description": "Indicates last known device state. 0 = awake, 1 = sleep, 6 = flight mode",
            "type": "number",
            "format": ""
          },
          "color": {
            "default": "fc7c3d",
            "type": "string"
          },
          "saveToWeb": {
            "default": false,
            "type": "boolean"
          },
          "active": {
            "default": false,
            "type": "boolean"
          },
          "deepSleep": {
            "default": false,
            "type": "boolean"
          },
          "simstate": {
            "default": "active",
            "type": "string"
          },
          "stripeSubscription": {
            "type": "string"
          },
          "subscriptionType": {
            "type": "string"
          },
          "meta": {
            "type": "object"
          },
          "siloId": {
            "type": "number",
            "format": ""
          },
          "resellerId": {
            "type": "number",
            "format": ""
          },
          "btPasskey": {
            "type": "number",
            "format": ""
          },
          "simType": {
            "default": "JT",
            "type": "string"
          },
          "id": {
            "type": "number",
            "format": ""
          },
          "ownerId": {
            "type": "number",
            "format": ""
          },
          "resellerPlanId": {
            "type": "number",
            "format": ""
          },
          "onoWhitelistId": {
            "type": "number",
            "format": ""
          }
        },
        "required": [
          "firstSeen"
        ]
      },
      "geofence": {
        "properties": {
          "outline": {
            "description": "Array of {lat:x,lng:y} objects representing the vertices of the polygon. Do not use with center and radius.",
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "center": {
            "$ref": "#/components/schemas/GeoPoint"
          },
          "radius": {
            "description": "For circular geofences, the radius of the circle in meters. Property is ignored if outline != null.",
            "type": "number",
            "format": ""
          },
          "type": {
            "description": "Grouping value",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "wasInside": {
            "default": false,
            "description": "If the last point received was inside the geofence. Only updated for notifications (not the safe-zone as that is evaluated on the device)",
            "type": "boolean"
          },
          "lastChecked": {
            "description": "When the geofence was last evaluated. Only updated for notifications (not the safe-zone as that is evaluated on the device)",
            "type": "string",
            "format": "date-time"
          },
          "modified": {
            "default": false,
            "type": "boolean"
          },
          "meta": {
            "type": "object"
          },
          "foreignId": {
            "type": "string"
          },
          "id": {
            "type": "number",
            "format": ""
          },
          "deviceId": {
            "type": "number",
            "format": ""
          },
          "configId": {
            "type": "number",
            "format": ""
          },
          "userId": {
            "type": "number",
            "format": ""
          }
        }
      },
      "accessToken": {
        "properties": {
          "id": {
            "type": "string"
          },
          "ttl": {
            "default": 1209600,
            "description": "time to live in seconds (2 weeks by default)",
            "type": "number",
            "format": ""
          },
          "scopes": {
            "description": "Array of scopes granted to this access token.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "userId": {
            "type": "number",
            "format": ""
          }
        },
        "required": [
          "id"
        ]
      },
      "iRtkNtrip": {
        "properties": {
          "deviceId": {
            "type": "number",
            "format": ""
          },
          "hostname": {
            "type": "string"
          },
          "portNum": {
            "type": "number",
            "format": ""
          },
          "mountpoint": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "password": {
            "type": "string"
          }
        },
        "required": [
          "deviceId"
        ]
      },
      "GeoPoint": {
        "properties": {
          "lat": {
            "type": "number"
          },
          "lng": {
            "type": "number"
          }
        }
      },
      "credentials": {
        "properties": {
          "username": {
            "type": "string"
          },
          "password": {
            "type": "string"
          }
        }
      }
    }
  }
}
