openapi: 3.0.1
servers:
  - description: Demo Server 1
    url: https://demo.traccar.org/api
  - description: Demo Server 2
    url: https://demo2.traccar.org/api
  - description: Demo Server 3
    url: https://demo3.traccar.org/api
  - description: Demo Server 4
    url: https://demo4.traccar.org/api
  - description: Subscription Server
    url: https://server.traccar.org/api
  - description: Other Server
    url: http://{host}:{port}/api
    variables:
      host:
        default: localhost
      port:
        default: "8082"
        enum:
          - "8082"
          - "80"
info:
  contact:
    email: support@traccar.org
    name: Traccar Support
    url: https://www.traccar.org/
  description: Open Source GPS Tracking Platform
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  title: Traccar
  version: "5.6"
  x-apisguru-categories:
    - location
  x-logo:
    url: https://pbs.twimg.com/profile_images/590395195268538368/oScd6DxA_400x400.png
  x-origin:
    - format: openapi
      url: https://raw.githubusercontent.com/tananaev/traccar/master/swagger.json
      version: "3.0"
  x-providerName: traccar.org
security:
  - basicAuth: []
tags:
  - description: Server information
    name: Server
  - description: User session management
    name: Session
  - description: Device management
    name: Devices
  - description: Group management
    name: Groups
  - description: User management
    name: Users
  - description: User permissions and other object linking
    name: Permissions
  - description: Retrieving raw location information
    name: Positions
  - description: Retrieving event information
    name: Events
  - description: Reports generation
    name: Reports
  - description: User notifications management
    name: Notifications
  - description: Geofence management
    name: Geofences
  - description: Sending commands to devices and stored command management
    name: Commands
  - description: Computed attributes management
    name: Attributes
  - description: Drivers management
    name: Drivers
  - description: Maintenance management
    name: Maintenance
  - description: Calendar management
    name: Calendars
  - description: Retrieving server statistics
    name: Statistics
paths:
  /attributes/computed:
    get:
      description: Without params, it returns a list of Attributes the user has access to
      parameters:
        - description: Can only be used by admins or managers to fetch all entities
          in: query
          name: all
          schema:
            type: boolean
        - description: Standard users can use this only with their own _userId_
          in: query
          name: userId
          schema:
            type: integer
        - description: Standard users can use this only with _deviceId_s, they have access to
          in: query
          name: deviceId
          schema:
            type: integer
        - description: Standard users can use this only with _groupId_s, they have access to
          in: query
          name: groupId
          schema:
            type: integer
        - in: query
          name: refresh
          schema:
            type: boolean
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Attribute"
                type: array
          description: OK
      summary: Fetch a list of Attributes
      tags:
        - Attributes
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Attribute"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Attribute"
          description: OK
      summary: Create an Attribute
      tags:
        - Attributes
      x-codegen-request-body-name: body
  "/attributes/computed/{id}":
    delete:
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        "204":
          content: {}
          description: No Content
      summary: Delete an Attribute
      tags:
        - Attributes
    put:
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Attribute"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Attribute"
          description: OK
      summary: Update an Attribute
      tags:
        - Attributes
      x-codegen-request-body-name: body
  /calendars:
    get:
      description: Without params, it returns a list of Calendars the user has access to
      parameters:
        - description: Can only be used by admins or managers to fetch all entities
          in: query
          name: all
          schema:
            type: boolean
        - description: Standard users can use this only with their own _userId_
          in: query
          name: userId
          schema:
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Calendar"
                type: array
          description: OK
      summary: Fetch a list of Calendars
      tags:
        - Calendars
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Calendar"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Calendar"
          description: OK
      summary: Create a Calendar
      tags:
        - Calendars
      x-codegen-request-body-name: body
  "/calendars/{id}":
    delete:
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        "204":
          content: {}
          description: No Content
      summary: Delete a Calendar
      tags:
        - Calendars
    put:
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Calendar"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Calendar"
          description: OK
      summary: Update a Calendar
      tags:
        - Calendars
      x-codegen-request-body-name: body
  /commands:
    get:
      description: Without params, it returns a list of Saved Commands the user has access to
      parameters:
        - description: Can only be used by admins or managers to fetch all entities
          in: query
          name: all
          schema:
            type: boolean
        - description: Standard users can use this only with their own _userId_
          in: query
          name: userId
          schema:
            type: integer
        - description: Standard users can use this only with _deviceId_s, they have access to
          in: query
          name: deviceId
          schema:
            type: integer
        - description: Standard users can use this only with _groupId_s, they have access to
          in: query
          name: groupId
          schema:
            type: integer
        - in: query
          name: refresh
          schema:
            type: boolean
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Command"
                type: array
          description: OK
      summary: Fetch a list of Saved Commands
      tags:
        - Commands
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Command"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Command"
          description: OK
      summary: Create a Saved Command
      tags:
        - Commands
      x-codegen-request-body-name: body
  /commands/send:
    get:
      description: Return a list of saved commands linked to Device and its groups, filtered by current Device protocol support
      parameters:
        - description: Standard users can use this only with _deviceId_s, they have access to
          in: query
          name: deviceId
          schema:
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Command"
                type: array
          description: OK
        "400":
          content: {}
          description: Could happen when the user doesn't have permission for the device
      summary: Fetch a list of Saved Commands supported by Device at the moment
      tags:
        - Commands
    post:
      description: Dispatch a new command or Saved Command if _body.id_ set
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Command"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Command"
          description: Command sent
        "202":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Command"
          description: Command queued
        "400":
          content: {}
          description: Could happen when the user doesn't have permission or an incorrect command _type_ for the device
      summary: Dispatch commands to device
      tags:
        - Commands
      x-codegen-request-body-name: body
  /commands/types:
    get:
      parameters:
        - description: Internal device identifier. Only works if device has already reported some locations
          in: query
          name: deviceId
          schema:
            type: integer
        - description: Protocol name. Can be used instead of device id
          in: query
          name: protocol
          schema:
            type: string
        - description: When `true` return SMS commands. If not specified or `false` return data commands
          in: query
          name: textChannel
          schema:
            type: boolean
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/CommandType"
                type: array
          description: OK
        "400":
          content: {}
          description: Could happen when trying to fetch from a device the user does not have permission
      summary: Fetch a list of available Commands for the Device or all possible Commands if Device ommited
      tags:
        - Commands
  "/commands/{id}":
    delete:
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        "204":
          content: {}
          description: No Content
      summary: Delete a Saved Command
      tags:
        - Commands
    put:
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Command"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Command"
          description: OK
      summary: Update a Saved Command
      tags:
        - Commands
      x-codegen-request-body-name: body
  /devices:
    get:
      description: Without any params, returns a list of the user's devices
      parameters:
        - description: Can only be used by admins or managers to fetch all entities
          in: query
          name: all
          schema:
            type: boolean
        - description: Standard users can use this only with their own _userId_
          in: query
          name: userId
          schema:
            type: integer
        - description: To fetch one or more devices. Multiple params can be passed like `id=31&id=42`
          in: query
          name: id
          schema:
            type: integer
        - description: To fetch one or more devices. Multiple params can be passed like `uniqueId=333331&uniqieId=44442`
          in: query
          name: uniqueId
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Device"
                type: array
          description: OK
        "400":
          content: {}
          description: No permission
      summary: Fetch a list of Devices
      tags:
        - Devices
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Device"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Device"
          description: OK
      summary: Create a Device
      tags:
        - Devices
      x-codegen-request-body-name: body
  "/devices/{id}":
    delete:
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        "204":
          content: {}
          description: No Content
      summary: Delete a Device
      tags:
        - Devices
    put:
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Device"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Device"
          description: OK
      summary: Update a Device
      tags:
        - Devices
      x-codegen-request-body-name: body
  "/devices/{id}/accumulators":
    put:
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DeviceAccumulators"
        required: true
      responses:
        "204":
          content: {}
          description: No Content
      summary: Update total distance and hours of the Device
      tags:
        - Devices
      x-codegen-request-body-name: body
  /drivers:
    get:
      description: Without params, it returns a list of Drivers the user has access to
      parameters:
        - description: Can only be used by admins or managers to fetch all entities
          in: query
          name: all
          schema:
            type: boolean
        - description: Standard users can use this only with their own _userId_
          in: query
          name: userId
          schema:
            type: integer
        - description: Standard users can use this only with _deviceId_s, they have access to
          in: query
          name: deviceId
          schema:
            type: integer
        - description: Standard users can use this only with _groupId_s, they have access to
          in: query
          name: groupId
          schema:
            type: integer
        - in: query
          name: refresh
          schema:
            type: boolean
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Driver"
                type: array
          description: OK
      summary: Fetch a list of Drivers
      tags:
        - Drivers
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Driver"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Driver"
          description: OK
      summary: Create a Driver
      tags:
        - Drivers
      x-codegen-request-body-name: body
  "/drivers/{id}":
    delete:
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        "204":
          content: {}
          description: No Content
      summary: Delete a Driver
      tags:
        - Drivers
    put:
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Driver"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Driver"
          description: OK
      summary: Update a Driver
      tags:
        - Drivers
      x-codegen-request-body-name: body
  "/events/{id}":
    get:
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Event"
          description: OK
      tags:
        - Events
  /geofences:
    get:
      description: Without params, it returns a list of Geofences the user has access to
      parameters:
        - description: Can only be used by admins or managers to fetch all entities
          in: query
          name: all
          schema:
            type: boolean
        - description: Standard users can use this only with their own _userId_
          in: query
          name: userId
          schema:
            type: integer
        - description: Standard users can use this only with _deviceId_s, they have access to
          in: query
          name: deviceId
          schema:
            type: integer
        - description: Standard users can use this only with _groupId_s, they have access to
          in: query
          name: groupId
          schema:
            type: integer
        - in: query
          name: refresh
          schema:
            type: boolean
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Geofence"
                type: array
          description: OK
      summary: Fetch a list of Geofences
      tags:
        - Geofences
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Geofence"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Geofence"
          description: OK
      summary: Create a Geofence
      tags:
        - Geofences
      x-codegen-request-body-name: body
  "/geofences/{id}":
    delete:
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        "204":
          content: {}
          description: No Content
      summary: Delete a Geofence
      tags:
        - Geofences
    put:
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Geofence"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Geofence"
          description: OK
      summary: Update a Geofence
      tags:
        - Geofences
      x-codegen-request-body-name: body
  /groups:
    get:
      description: Without any params, returns a list of the Groups the user belongs to
      parameters:
        - description: Can only be used by admins or managers to fetch all entities
          in: query
          name: all
          schema:
            type: boolean
        - description: Standard users can use this only with their own _userId_
          in: query
          name: userId
          schema:
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Group"
                type: array
          description: OK
      summary: Fetch a list of Groups
      tags:
        - Groups
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Group"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Group"
          description: OK
        "400":
          content: {}
          description: No permission
      summary: Create a Group
      tags:
        - Groups
      x-codegen-request-body-name: body
  "/groups/{id}":
    delete:
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        "204":
          content: {}
          description: No Content
      summary: Delete a Group
      tags:
        - Groups
    put:
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Group"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Group"
          description: OK
      summary: Update a Group
      tags:
        - Groups
      x-codegen-request-body-name: body
  /maintenance:
    get:
      description: Without params, it returns a list of Maintenance the user has access to
      parameters:
        - description: Can only be used by admins or managers to fetch all entities
          in: query
          name: all
          schema:
            type: boolean
        - description: Standard users can use this only with their own _userId_
          in: query
          name: userId
          schema:
            type: integer
        - description: Standard users can use this only with _deviceId_s, they have access to
          in: query
          name: deviceId
          schema:
            type: integer
        - description: Standard users can use this only with _groupId_s, they have access to
          in: query
          name: groupId
          schema:
            type: integer
        - in: query
          name: refresh
          schema:
            type: boolean
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Maintenance"
                type: array
          description: OK
      summary: Fetch a list of Maintenance
      tags:
        - Maintenance
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Maintenance"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Maintenance"
          description: OK
      summary: Create a Maintenance
      tags:
        - Maintenance
      x-codegen-request-body-name: body
  "/maintenance/{id}":
    delete:
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        "204":
          content: {}
          description: No Content
      summary: Delete a Maintenance
      tags:
        - Maintenance
    put:
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Maintenance"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Maintenance"
          description: OK
      summary: Update a Maintenance
      tags:
        - Maintenance
      x-codegen-request-body-name: body
  /notifications:
    get:
      description: Without params, it returns a list of Notifications the user has access to
      parameters:
        - description: Can only be used by admins or managers to fetch all entities
          in: query
          name: all
          schema:
            type: boolean
        - description: Standard users can use this only with their own _userId_
          in: query
          name: userId
          schema:
            type: integer
        - description: Standard users can use this only with _deviceId_s, they have access to
          in: query
          name: deviceId
          schema:
            type: integer
        - description: Standard users can use this only with _groupId_s, they have access to
          in: query
          name: groupId
          schema:
            type: integer
        - in: query
          name: refresh
          schema:
            type: boolean
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Notification"
                type: array
          description: OK
      summary: Fetch a list of Notifications
      tags:
        - Notifications
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Notification"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Notification"
          description: OK
      summary: Create a Notification
      tags:
        - Notifications
      x-codegen-request-body-name: body
  /notifications/test:
    post:
      responses:
        "204":
          content: {}
          description: Successful sending
        "400":
          content: {}
          description: Could happen if sending has failed
      summary: Send test notification to current user via Email and SMS
      tags:
        - Notifications
  /notifications/types:
    get:
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/NotificationType"
                type: array
          description: OK
      summary: Fetch a list of available Notification types
      tags:
        - Notifications
  "/notifications/{id}":
    delete:
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        "204":
          content: {}
          description: No Content
      summary: Delete a Notification
      tags:
        - Notifications
    put:
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Notification"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Notification"
          description: OK
      summary: Update a Notification
      tags:
        - Notifications
      x-codegen-request-body-name: body
  /permissions:
    delete:
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Permission"
        required: true
      responses:
        "204":
          content: {}
          description: No Content
      summary: Unlink an Object from another Object
      tags:
        - Permissions
      x-codegen-request-body-name: body
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Permission"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Permission"
          description: OK
        "400":
          content: {}
          description: No permission
      summary: Link an Object to another Object
      tags:
        - Permissions
      x-codegen-request-body-name: body
  /positions:
    get:
      description: We strongly recommend using [Traccar WebSocket API](https://www.traccar.org/traccar-api/) instead of periodically polling positions endpoint. Without any params, it returns a list of last known positions for all the user's Devices. _from_ and _to_ fields are not required with _id_.
      parameters:
        - description: _deviceId_ is optional, but requires the _from_ and _to_ parameters when used
          in: query
          name: deviceId
          schema:
            type: integer
        - description: in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
          in: query
          name: from
          schema:
            format: date-time
            type: string
        - description: in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
          in: query
          name: to
          schema:
            format: date-time
            type: string
        - description: To fetch one or more positions. Multiple params can be passed like `id=31&id=42`
          in: query
          name: id
          schema:
            type: integer
      responses:
        "200":
          content:
            application/gpx+xml:
              schema:
                items:
                  $ref: "#/components/schemas/Position"
                type: array
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Position"
                type: array
            text/csv:
              schema:
                items:
                  $ref: "#/components/schemas/Position"
                type: array
          description: OK
      summary: Fetches a list of Positions
      tags:
        - Positions
  /reports/events:
    get:
      description: At least one _deviceId_ or one _groupId_ must be passed
      parameters:
        - explode: true
          in: query
          name: deviceId
          schema:
            items:
              type: integer
            type: array
          style: form
        - explode: true
          in: query
          name: groupId
          schema:
            items:
              type: integer
            type: array
          style: form
        - description: "% can be used to return events of all types"
          explode: false
          in: query
          name: type
          schema:
            items:
              type: string
            type: array
          style: form
        - description: in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
          in: query
          name: from
          required: true
          schema:
            format: date-time
            type: string
        - description: in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
          in: query
          name: to
          required: true
          schema:
            format: date-time
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Event"
                type: array
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
              schema:
                items:
                  $ref: "#/components/schemas/Event"
                type: array
          description: OK
      summary: Fetch a list of Events within the time period for the Devices or Groups
      tags:
        - Reports
  /reports/route:
    get:
      description: At least one _deviceId_ or one _groupId_ must be passed
      parameters:
        - explode: true
          in: query
          name: deviceId
          schema:
            items:
              type: integer
            type: array
          style: form
        - explode: true
          in: query
          name: groupId
          schema:
            items:
              type: integer
            type: array
          style: form
        - description: in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
          in: query
          name: from
          required: true
          schema:
            format: date-time
            type: string
        - description: in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
          in: query
          name: to
          required: true
          schema:
            format: date-time
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Position"
                type: array
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
              schema:
                items:
                  $ref: "#/components/schemas/Position"
                type: array
          description: OK
      summary: Fetch a list of Positions within the time period for the Devices or Groups
      tags:
        - Reports
  /reports/stops:
    get:
      description: At least one _deviceId_ or one _groupId_ must be passed
      parameters:
        - explode: true
          in: query
          name: deviceId
          schema:
            items:
              type: integer
            type: array
          style: form
        - explode: true
          in: query
          name: groupId
          schema:
            items:
              type: integer
            type: array
          style: form
        - description: in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
          in: query
          name: from
          required: true
          schema:
            format: date-time
            type: string
        - description: in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
          in: query
          name: to
          required: true
          schema:
            format: date-time
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/ReportStops"
                type: array
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
              schema:
                items:
                  $ref: "#/components/schemas/ReportStops"
                type: array
          description: OK
      summary: Fetch a list of ReportStops within the time period for the Devices or Groups
      tags:
        - Reports
  /reports/summary:
    get:
      description: At least one _deviceId_ or one _groupId_ must be passed
      parameters:
        - explode: true
          in: query
          name: deviceId
          schema:
            items:
              type: integer
            type: array
          style: form
        - explode: true
          in: query
          name: groupId
          schema:
            items:
              type: integer
            type: array
          style: form
        - description: in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
          in: query
          name: from
          required: true
          schema:
            format: date-time
            type: string
        - description: in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
          in: query
          name: to
          required: true
          schema:
            format: date-time
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/ReportSummary"
                type: array
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
              schema:
                items:
                  $ref: "#/components/schemas/ReportSummary"
                type: array
          description: OK
      summary: Fetch a list of ReportSummary within the time period for the Devices or Groups
      tags:
        - Reports
  /reports/trips:
    get:
      description: At least one _deviceId_ or one _groupId_ must be passed
      parameters:
        - explode: true
          in: query
          name: deviceId
          schema:
            items:
              type: integer
            type: array
          style: form
        - explode: true
          in: query
          name: groupId
          schema:
            items:
              type: integer
            type: array
          style: form
        - description: in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
          in: query
          name: from
          required: true
          schema:
            format: date-time
            type: string
        - description: in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
          in: query
          name: to
          required: true
          schema:
            format: date-time
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/ReportTrips"
                type: array
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
              schema:
                items:
                  $ref: "#/components/schemas/ReportTrips"
                type: array
          description: OK
      summary: Fetch a list of ReportTrips within the time period for the Devices or Groups
      tags:
        - Reports
  /server:
    get:
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Server"
          description: OK
      summary: Fetch Server information
      tags:
        - Server
    put:
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Server"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Server"
          description: OK
      summary: Update Server information
      tags:
        - Server
      x-codegen-request-body-name: body
  /session:
    delete:
      responses:
        "204":
          content: {}
          description: No Content
      summary: Close the Session
      tags:
        - Session
    get:
      parameters:
        - in: query
          name: token
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/User"
          description: OK
        "404":
          content: {}
          description: Not Found
      summary: Fetch Session information
      tags:
        - Session
    post:
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              properties:
                email:
                  type: string
                password:
                  format: password
                  type: string
              required:
                - email
                - password
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/User"
          description: OK
        "401":
          content: {}
          description: Unauthorized
      summary: Create a new Session
      tags:
        - Session
  /statistics:
    get:
      parameters:
        - description: in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
          in: query
          name: from
          required: true
          schema:
            format: date-time
            type: string
        - description: in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
          in: query
          name: to
          required: true
          schema:
            format: date-time
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Statistics"
                type: array
          description: OK
      summary: Fetch server Statistics
      tags:
        - Statistics
  /users:
    get:
      parameters:
        - description: Can only be used by admin or manager users
          in: query
          name: userId
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/User"
                type: array
          description: OK
        "400":
          content: {}
          description: No Permission
      summary: Fetch a list of Users
      tags:
        - Users
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/User"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/User"
          description: OK
      summary: Create a User
      tags:
        - Users
      x-codegen-request-body-name: body
  "/users/{id}":
    delete:
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        "204":
          content: {}
          description: No Content
      summary: Delete a User
      tags:
        - Users
    put:
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/User"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/User"
          description: OK
      summary: Update a User
      tags:
        - Users
      x-codegen-request-body-name: body
components:
  parameters:
    all:
      description: Can only be used by admins or managers to fetch all entities
      in: query
      name: all
      schema:
        type: boolean
    deviceId:
      description: Standard users can use this only with _deviceId_s, they have access to
      in: query
      name: deviceId
      schema:
        type: integer
    deviceIdArray:
      explode: true
      in: query
      name: deviceId
      schema:
        items:
          type: integer
        type: array
      style: form
    entityId:
      in: path
      name: id
      required: true
      schema:
        type: integer
    fromTime:
      description: in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
      in: query
      name: from
      required: true
      schema:
        format: date-time
        type: string
    groupId:
      description: Standard users can use this only with _groupId_s, they have access to
      in: query
      name: groupId
      schema:
        type: integer
    groupIdArray:
      explode: true
      in: query
      name: groupId
      schema:
        items:
          type: integer
        type: array
      style: form
    refresh:
      in: query
      name: refresh
      schema:
        type: boolean
    toTime:
      description: in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
      in: query
      name: to
      required: true
      schema:
        format: date-time
        type: string
    userId:
      description: Standard users can use this only with their own _userId_
      in: query
      name: userId
      schema:
        type: integer
  requestBodies:
    Attribute:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Attribute"
      required: true
    Calendar:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Calendar"
      required: true
    Command:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Command"
      required: true
    Device:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Device"
      required: true
    Driver:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Driver"
      required: true
    Geofence:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Geofence"
      required: true
    Group:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Group"
      required: true
    Maintenance:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Maintenance"
      required: true
    Notification:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Notification"
      required: true
    Permission:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Permission"
      required: true
    User:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/User"
      required: true
  schemas:
    Attribute:
      properties:
        attribute:
          type: string
        description:
          type: string
        expression:
          type: string
        id:
          type: integer
        type:
          description: String|Number|Boolean
          type: string
      type: object
    Calendar:
      properties:
        attributes:
          properties: {}
          type: object
        data:
          description: base64 encoded in iCalendar format
          type: string
        id:
          type: integer
        name:
          type: string
      type: object
    Command:
      properties:
        attributes:
          properties: {}
          type: object
        description:
          type: string
        deviceId:
          type: integer
        id:
          type: integer
        type:
          type: string
      type: object
    CommandType:
      properties:
        type:
          type: string
      type: object
    Device:
      properties:
        attributes:
          properties: {}
          type: object
        category:
          type: string
        contact:
          type: string
        disabled:
          type: boolean
        geofenceIds:
          items:
            type: integer
          type: array
        groupId:
          type: integer
        id:
          type: integer
        lastUpdate:
          description: in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
          format: date-time
          type: string
        model:
          type: string
        name:
          type: string
        phone:
          type: string
        positionId:
          type: integer
        status:
          type: string
        uniqueId:
          type: string
      type: object
    DeviceAccumulators:
      properties:
        deviceId:
          type: integer
        hours:
          type: number
        totalDistance:
          description: in meters
          type: number
      type: object
    Driver:
      properties:
        attributes:
          properties: {}
          type: object
        id:
          type: integer
        name:
          type: string
        uniqueId:
          type: string
      type: object
    Event:
      properties:
        attributes:
          properties: {}
          type: object
        deviceId:
          type: integer
        eventTime:
          description: in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
          format: date-time
          type: string
        geofenceId:
          type: integer
        id:
          type: integer
        maintenanceId:
          type: integer
        positionId:
          type: integer
        type:
          type: string
      type: object
    Geofence:
      properties:
        area:
          type: string
        attributes:
          properties: {}
          type: object
        calendarId:
          type: integer
        description:
          type: string
        id:
          type: integer
        name:
          type: string
      type: object
    Group:
      properties:
        attributes:
          properties: {}
          type: object
        groupId:
          type: integer
        id:
          type: integer
        name:
          type: string
      type: object
    Maintenance:
      properties:
        attributes:
          properties: {}
          type: object
        id:
          type: integer
        name:
          type: string
        period:
          type: number
        start:
          type: number
        type:
          type: string
      type: object
    Notification:
      properties:
        always:
          type: boolean
        attributes:
          properties: {}
          type: object
        calendarId:
          type: integer
        id:
          type: integer
        mail:
          type: boolean
        sms:
          type: boolean
        type:
          type: string
        web:
          type: boolean
      type: object
    NotificationType:
      properties:
        type:
          type: string
      type: object
    Permission:
      description: "This is a permission map that contain two object indexes. It is used to link/unlink objects. Order is important. Example: { deviceId:8, geofenceId: 16 }"
      properties:
        attributeId:
          description: Computed Attribute Id, can be second parameter only
          type: integer
        calendarId:
          description: Calendar Id, can be second parameter only and only in combination with userId
          type: integer
        deviceId:
          description: Device Id, can be first parameter or second only in combination with userId
          type: integer
        driverId:
          description: Driver Id, can be second parameter only
          type: integer
        geofenceId:
          description: Geofence Id, can be second parameter only
          type: integer
        groupId:
          description: Group Id, can be first parameter or second only in combination with userId
          type: integer
        managedUserId:
          description: User Id, can be second parameter only and only in combination with userId
          type: integer
        notificationId:
          description: Notification Id, can be second parameter only
          type: integer
        userId:
          description: User Id, can be only first parameter
          type: integer
      type: object
    Position:
      properties:
        accuracy:
          type: number
        address:
          type: string
        altitude:
          type: number
        attributes:
          properties: {}
          type: object
        course:
          type: number
        deviceId:
          type: integer
        deviceTime:
          description: in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
          format: date-time
          type: string
        fixTime:
          description: in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
          format: date-time
          type: string
        id:
          type: integer
        latitude:
          type: number
        longitude:
          type: number
        network:
          properties: {}
          type: object
        outdated:
          type: boolean
        protocol:
          type: string
        serverTime:
          description: in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
          format: date-time
          type: string
        speed:
          description: in knots
          type: number
        valid:
          type: boolean
      type: object
    ReportStops:
      properties:
        address:
          type: string
        deviceId:
          type: integer
        deviceName:
          type: string
        duration:
          type: integer
        endTime:
          description: in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
          format: date-time
          type: string
        engineHours:
          type: integer
        lat:
          type: number
        lon:
          type: number
        spentFuel:
          description: in liters
          type: number
        startTime:
          description: in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
          format: date-time
          type: string
      type: object
    ReportSummary:
      properties:
        averageSpeed:
          description: in knots
          type: number
        deviceId:
          type: integer
        deviceName:
          type: string
        distance:
          description: in meters
          type: number
        engineHours:
          type: integer
        maxSpeed:
          description: in knots
          type: number
        spentFuel:
          description: in liters
          type: number
      type: object
    ReportTrips:
      properties:
        averageSpeed:
          description: in knots
          type: number
        deviceId:
          type: integer
        deviceName:
          type: string
        distance:
          description: in meters
          type: number
        driverName:
          type: string
        driverUniqueId:
          type: integer
        duration:
          type: integer
        endAddress:
          type: string
        endLat:
          type: number
        endLon:
          type: number
        endTime:
          description: in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
          format: date-time
          type: string
        maxSpeed:
          description: in knots
          type: number
        spentFuel:
          description: in liters
          type: number
        startAddress:
          type: string
        startLat:
          type: number
        startLon:
          type: number
        startTime:
          description: in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
          format: date-time
          type: string
      type: object
    Server:
      properties:
        attributes:
          properties: {}
          type: object
        bingKey:
          type: string
        coordinateFormat:
          type: string
        deviceReadonly:
          type: boolean
        forceSettings:
          type: boolean
        id:
          type: integer
        latitude:
          type: number
        limitCommands:
          type: boolean
        longitude:
          type: number
        map:
          type: string
        mapUrl:
          type: string
        poiLayer:
          type: string
        readonly:
          type: boolean
        registration:
          type: boolean
        twelveHourFormat:
          type: boolean
        version:
          type: string
        zoom:
          type: integer
      type: object
    Statistics:
      properties:
        activeDevices:
          type: integer
        activeUsers:
          type: integer
        captureTime:
          description: in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
          format: date-time
          type: string
        messagesReceived:
          type: integer
        messagesStored:
          type: integer
        requests:
          type: integer
      type: object
    User:
      properties:
        administrator:
          type: boolean
        attributes:
          properties: {}
          type: object
        coordinateFormat:
          type: string
        deviceLimit:
          type: integer
        deviceReadonly:
          type: boolean
        disabled:
          type: boolean
        email:
          type: string
        expirationTime:
          description: in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
          format: date-time
          type: string
        id:
          type: integer
        latitude:
          type: number
        limitCommands:
          type: boolean
        longitude:
          type: number
        map:
          type: string
        name:
          type: string
        password:
          type: string
        phone:
          type: string
        poiLayer:
          type: string
        readonly:
          type: boolean
        twelveHourFormat:
          type: boolean
        userLimit:
          type: integer
        zoom:
          type: integer
      type: object
  securitySchemes:
    basicAuth:
      description: Basic HTTP authorization with _email_ and _password_
      scheme: basic
      type: http
