{
  "openapi": "3.0.3",
  "info": {
    "title": "ZERION ELD API",
    "version": "1.0.0",
    "description": "Read-only access to your ZERION ELD fleet: vehicles, drivers, current duty status and last known vehicle position."
  },
  "servers": [
    {
      "url": "http://app.zerioneld.com/api/HosconnectApi"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "paths": {
    "/Authentication": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "operationId": "auth_login",
        "summary": "Get an access token",
        "description": "Exchange your API credentials for a bearer token.\n\nThe token is a JWT valid for 24 hours. Send it as an Authorization: Bearer header on every other endpoint. Credentials are issued per company — contact support to have an API user created for your account.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "user": "acme-api",
                "password": "••••••••",
                "company": "7c9e1f4a-2b56-4d1e-9f30-8a1b2c3d4e5f"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGki..."
                }
              }
            }
          },
          "400": {
            "description": "\"Not found this user.\" — No API user matches the supplied user and password.\n\"This user deleted.\" — The API user exists but has been deactivated.\n\"Not found this company.\" — The company token is not recognised."
          }
        },
        "security": []
      }
    },
    "/Companies": {
      "post": {
        "tags": [
          "Company"
        ],
        "operationId": "company_get",
        "summary": "Get company",
        "description": "Resolve a company token to the company it belongs to.\n\nUseful as a connectivity check before authenticating: it confirms a company token is valid without needing credentials.",
        "parameters": [
          {
            "name": "ID",
            "in": "query",
            "required": true,
            "description": "The company token.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "_id": "7c9e1f4a-2b56-4d1e-9f30-8a1b2c3d4e5f",
                  "name": "Acme Trucking LLC"
                }
              }
            }
          },
          "400": {
            "description": "\"Not found Company.\" — No company matches that token."
          }
        },
        "security": []
      }
    },
    "/vehicles": {
      "post": {
        "tags": [
          "Vehicles"
        ],
        "operationId": "vehicles_list",
        "summary": "List vehicles",
        "description": "Every vehicle on your account, ordered by unit number.\n\nDeactivated vehicles are included with active: false, so you can reconcile historical records.",
        "parameters": [
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "description": "Number of records to skip. Use with limit to page through large fleets.",
            "schema": {
              "type": "integer",
              "default": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of records to return.",
            "schema": {
              "type": "integer",
              "default": 1000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "data": [
                    {
                      "_id": "4821",
                      "name": "104",
                      "vin": "1FUJGLDR8CLBP8834",
                      "active": true,
                      "companyId": "7c9e1f4a-2b56-4d1e-9f30-8a1b2c3d4e5f"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized — Missing, malformed, or expired bearer token. Tokens are valid for 24 hours — call Authentication again."
          },
          "400": {
            "description": "\"Not found api user.\" — The API user behind the token has since been deleted."
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/vehicle": {
      "post": {
        "tags": [
          "Vehicles"
        ],
        "operationId": "vehicle_get",
        "summary": "Get a vehicle",
        "description": "A single vehicle by ID.\n\nReturned unwrapped — this endpoint responds with the vehicle object itself, not a data array.",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Vehicle ID, as returned in _id by List vehicles.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "_id": "4821",
                  "name": "104",
                  "vin": "1FUJGLDR8CLBP8834",
                  "active": true,
                  "companyId": "7c9e1f4a-2b56-4d1e-9f30-8a1b2c3d4e5f"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized — Missing, malformed, or expired bearer token. Tokens are valid for 24 hours — call Authentication again."
          },
          "400": {
            "description": "\"Not found api user.\" — The API user behind the token has since been deleted.\n\"Not found vehicle.\" — No vehicle with that ID belongs to your company."
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/drivers": {
      "post": {
        "tags": [
          "Drivers"
        ],
        "operationId": "drivers_list",
        "summary": "List drivers",
        "description": "Active drivers on your account, ordered by name.\n\nUnlike vehicles, deactivated drivers are omitted entirely.",
        "parameters": [
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "description": "Number of records to skip. Use with limit to page through large fleets.",
            "schema": {
              "type": "integer",
              "default": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of records to return.",
            "schema": {
              "type": "integer",
              "default": 1000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "data": [
                    {
                      "_id": "9134",
                      "username": "jdoe",
                      "firstName": "John",
                      "lastName": "Doe",
                      "companyId": "7c9e1f4a-2b56-4d1e-9f30-8a1b2c3d4e5f"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized — Missing, malformed, or expired bearer token. Tokens are valid for 24 hours — call Authentication again."
          },
          "400": {
            "description": "\"Not found api user.\" — The API user behind the token has since been deleted."
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/driver": {
      "post": {
        "tags": [
          "Drivers"
        ],
        "operationId": "driver_get",
        "summary": "Get a driver",
        "description": "A single active driver by ID.\n\nReturned unwrapped — this endpoint responds with the driver object itself, not a data array.",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Driver ID, as returned in _id by List drivers.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "_id": "9134",
                  "username": "jdoe",
                  "firstName": "John",
                  "lastName": "Doe",
                  "companyId": "7c9e1f4a-2b56-4d1e-9f30-8a1b2c3d4e5f"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized — Missing, malformed, or expired bearer token. Tokens are valid for 24 hours — call Authentication again."
          },
          "400": {
            "description": "\"Not found api user.\" — The API user behind the token has since been deleted.\n\"Not found driver.\" — No active driver with that ID belongs to your company."
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/latest_driver_statuses": {
      "post": {
        "tags": [
          "Last Driver Status"
        ],
        "operationId": "driver_status_latest",
        "summary": "Last driver status",
        "description": "Current duty status and remaining hours for every driver, or for one driver.\n\nOmit id (or send 0) for the whole fleet; pass a driver ID for a single driver. The clock fields are seconds remaining; the matching *Text fields are the same values formatted as HH:MM for display, and go negative once a limit is exceeded.",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": false,
            "description": "Driver ID to filter by. 0 returns all drivers.",
            "schema": {
              "type": "integer",
              "default": 0
            }
          },
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "description": "Number of records to skip. Use with limit to page through large fleets.",
            "schema": {
              "type": "integer",
              "default": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of records to return.",
            "schema": {
              "type": "integer",
              "default": 1000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "data": [
                    {
                      "CompanyId": "7c9e1f4a-2b56-4d1e-9f30-8a1b2c3d4e5f",
                      "UserId": null,
                      "DriverID": 9134,
                      "dutyStatus": "DS_D",
                      "Break": 12600,
                      "Drive": 21600,
                      "Shift": 25200,
                      "Cycle": 158400,
                      "BreakText": "03:30",
                      "DriveText": "06:00",
                      "ShiftText": "07:00",
                      "CycleText": "44:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized — Missing, malformed, or expired bearer token. Tokens are valid for 24 hours — call Authentication again."
          },
          "400": {
            "description": "\"Not found api user.\" — The API user behind the token has since been deleted."
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/latest_vehicle_statuses": {
      "post": {
        "tags": [
          "Last Vehicle Status"
        ],
        "operationId": "vehicle_status_latest",
        "summary": "Last vehicle status",
        "description": "Latest known position, speed and odometer for every vehicle, or for one vehicle.\n\nOmit id (or send 0) for the whole fleet; pass a vehicle ID for a single vehicle. Positions come from the last GPS record received from the device, so a vehicle that is parked out of coverage keeps reporting its last known point.",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": false,
            "description": "Vehicle ID to filter by. 0 returns all vehicles.",
            "schema": {
              "type": "integer",
              "default": 0
            }
          },
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "description": "Number of records to skip. Use with limit to page through large fleets.",
            "schema": {
              "type": "integer",
              "default": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of records to return.",
            "schema": {
              "type": "integer",
              "default": 1000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "data": [
                    {
                      "CompanyId": "7c9e1f4a-2b56-4d1e-9f30-8a1b2c3d4e5f",
                      "vehicleId": "4821",
                      "lat": 41.878113,
                      "lon": -87.629799,
                      "speed": 62,
                      "odometer": 418327,
                      "code": "M",
                      "time": "2026-08-26 14:32:07"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized — Missing, malformed, or expired bearer token. Tokens are valid for 24 hours — call Authentication again."
          },
          "400": {
            "description": "\"Not found api user.\" — The API user behind the token has since been deleted."
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  }
}