openapi: 3.0.0
servers:
  - url: //api.edrv.io
info:
  contact:
    email: hello@edrv.io
    name: eDRV
    url: https://edrv.io
  description: edrv.io API Documentation
  title: eDRV API
  version: v1
  x-apisguru-categories:
    - open_data
    - transport
    - location
  x-logo:
    url: https://uploads-ssl.webflow.com/5eb5ba31ecd0593f18002773/5edcf57799287361407a98a4_Untitled%20(3)-p-500.png
  x-origin:
    - format: openapi
      url: https://developers.edrv.io/openapi/5f15c43c87b0d6001ea97414
      version: "3.0"
  x-providerName: edrv.io
security:
  - oauth2: []
paths:
  /v1/chargestations:
    get:
      description: List all Chargestations
      operationId: getChargeStations
      parameters:
        - description: Filter by Org. Id
          in: query
          name: organization
          schema:
            type: string
        - description: Filter by Location Id
          in: query
          name: location
          schema:
            type: string
        - description: Filter by Online Status
          in: query
          name: online
          schema:
            type: boolean
        - description: Chargestations that have been activated/deactivated by the admin
          in: query
          name: active
          schema:
            type: boolean
        - description: Chargestations that are public
          in: query
          name: public
          schema:
            type: boolean
        - $ref: "#/components/parameters/paginate_limit1"
        - $ref: "#/components/parameters/paginate_page1"
        - $ref: "#/components/parameters/paginate_enabled1"
        - $ref: "#/components/parameters/sort_by1"
        - $ref: "#/components/parameters/sort_order1"
        - $ref: "#/components/parameters/parameter1"
        - $ref: "#/components/parameters/parameter2"
        - $ref: "#/components/parameters/parameter3"
        - $ref: "#/components/parameters/parameter4"
        - description: Populate location
          in: query
          name: include_location
          schema:
            type: boolean
        - description: Populate evses
          in: query
          name: include_evses
          schema:
            type: boolean
        - $ref: "#/components/parameters/include_organization1"
      responses:
        "200":
          description: An array of chargestation objects
      tags:
        - Charge Stations
    post:
      description: Create a new charge station
      operationId: postChargeStations
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/schema1"
        description: Include charge station properties to create here
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                properties:
                  chargestation:
                    type: object
                  message:
                    type: string
                  ok:
                    type: boolean
                type: object
          description: Returns the newly created chargestion object
        "400":
          description: A failure response
      tags:
        - Charge Stations
  "/v1/chargestations/{id}":
    delete:
      description: Use to delete a charge station
      operationId: deleteChargeStation
      parameters:
        - description: The charge station id that needs to be deleted
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Returns the deleted chargestion object
        "400":
          description: Request Error
      tags:
        - Charge Stations
    get:
      description: Get a single charge station's data
      operationId: getChargeStation
      parameters:
        - description: The charge station id that needs to be fetched
          in: path
          name: id
          required: true
          schema:
            type: string
        - description: Populate location
          in: query
          name: include_location
          schema:
            type: boolean
        - description: Populate evses
          in: query
          name: include_evses
          schema:
            type: boolean
        - description: Populate organization
          in: query
          name: include_organization
          schema:
            type: boolean
      responses:
        "200":
          description: Returns a chargestion object
      tags:
        - Charge Stations
    patch:
      description: Update a charge station's data
      operationId: patchChargeStation
      parameters:
        - description: ID of charge station that needs to be updated
          in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/schema1"
        description: Include charge station properties to update here
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                  ok:
                    type: boolean
                  result:
                    type: object
                type: object
          description: Returns the updated chargestion object
        "400":
          description: A failure response
      tags:
        - Charge Stations
  "/v1/chargestations/{id}/connectors":
    get:
      description: List connectors for a chargestation
      operationId: getChargeStationConnectors
      parameters:
        - description: chargeStation id
          in: path
          name: id
          required: true
          schema:
            type: string
        - $ref: "#/components/parameters/include_evse1"
        - $ref: "#/components/parameters/include_organization1"
      responses:
        "200":
          description: Returns an array of connector objects
        "400":
          description: A failure response
      tags:
        - Charge Stations
  /v1/commands:
    get:
      description: Get Commands data
      operationId: getCommands
      parameters:
        - $ref: "#/components/parameters/paginate_limit1"
        - $ref: "#/components/parameters/paginate_page1"
        - $ref: "#/components/parameters/paginate_enabled1"
        - $ref: "#/components/parameters/sort_by1"
        - $ref: "#/components/parameters/sort_order1"
        - $ref: "#/components/parameters/parameter1"
        - $ref: "#/components/parameters/parameter2"
        - $ref: "#/components/parameters/parameter3"
        - $ref: "#/components/parameters/parameter4"
        - $ref: "#/components/parameters/include_chargestation1"
        - $ref: "#/components/parameters/include_driver1"
        - description: Populate transaction
          in: query
          name: include_transaction
          schema:
            type: boolean
        - $ref: "#/components/parameters/include_organization1"
      responses:
        "200":
          description: Success
      tags:
        - Commands
  /v1/commands/cancelreservation:
    post:
      description: Use to request a delete an existing reservation. The request will wait for the charge station to process the command. It will timeout after 60 seconds.
      operationId: cancelreservation
      requestBody:
        content:
          application/json:
            schema:
              properties:
                reservation:
                  type: string
              type: object
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                  ok:
                    type: boolean
                  result:
                    type: object
                type: object
          description: A successful response
        "400":
          description: A failure response
      tags:
        - Commands
  /v1/commands/chargingschedule:
    delete:
      description: Delete a smart charging schedule
      operationId: deletechargingschedule
      requestBody:
        content:
          application/json:
            schema:
              properties:
                id:
                  type: string
              type: object
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                properties:
                  command:
                    type: object
                  message:
                    type: string
                  ok:
                    type: boolean
                type: object
          description: A successful response
        "400":
          description: Schedule not found
      tags:
        - Smart Charging
    post:
      description: Set one of charging power or current of a specific chargestation connector
      operationId: setchargingschedule
      requestBody:
        content:
          application/json:
            schema:
              properties:
                connector:
                  type: string
                schedule:
                  items:
                    properties:
                      endDate:
                        type: string
                      limit:
                        type: number
                      startDate:
                        type: string
                      unit:
                        type: string
                    type: object
                  type: array
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                properties:
                  command:
                    type: object
                  message:
                    type: string
                  ok:
                    type: boolean
                type: object
          description: A successful response
        "400":
          description: A failure response
      tags:
        - Smart Charging
  /v1/commands/remotestart:
    post:
      description: Use to request a remote start command. The request will wait for the charge station to process the command. It will timeout after 60 seconds.
      operationId: remotestart
      requestBody:
        content:
          application/json:
            schema:
              properties:
                chargestation:
                  type: string
                connector:
                  type: string
                driver:
                  type: string
                token:
                  type: string
              type: object
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                properties:
                  command:
                    type: object
                  message:
                    type: string
                  ok:
                    type: boolean
                type: object
          description: A successful response
        "400":
          description: A failure response
      tags:
        - Commands
  /v1/commands/remotestop:
    post:
      description: Use to request a remote stop command. The request will wait for the charge station to process the command. It will timeout after 60 seconds.
      operationId: remotestop
      requestBody:
        content:
          application/json:
            schema:
              properties:
                chargestation:
                  type: string
                driver:
                  type: string
                transaction:
                  type: string
              type: object
        description: Remote stop transaction info here.
        required: true
      responses:
        "201":
          description: A successful response
        "400":
          description: A failure response
      tags:
        - Commands
  /v1/commands/reserve:
    post:
      description: Use to request a reserve command. The request will wait for the charge station to process the command. It will timeout after 60 seconds.
      operationId: reserve
      requestBody:
        content:
          application/json:
            schema:
              properties:
                chargestation:
                  type: string
                connector:
                  type: string
                driver:
                  type: string
                endDate:
                  type: string
                token:
                  type: string
              type: object
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                properties:
                  command:
                    type: object
                  message:
                    type: string
                  ok:
                    type: boolean
                type: object
          description: A successful response
        "400":
          description: A failure response
      tags:
        - Commands
  /v1/commands/reset:
    post:
      description: Use to request a reset command. The request will wait for the charge station to process the command. It will timeout after 60 seconds.
      operationId: reset
      requestBody:
        content:
          application/json:
            schema:
              properties:
                chargestation:
                  type: string
                type:
                  type: string
              type: object
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                  ok:
                    type: boolean
                  result:
                    type: object
                type: object
          description: A successful response
        "400":
          description: A failure response
      tags:
        - Commands
  /v1/commands/unlockconnector:
    post:
      description: Use to request an unlock command for a connector. The request will wait for the charge station to process the command. It will timeout after 60 seconds.
      operationId: unlockconnector
      requestBody:
        content:
          application/json:
            schema:
              properties:
                chargestation:
                  type: string
                connector:
                  type: string
              type: object
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                properties:
                  command:
                    type: object
                  message:
                    type: string
                  ok:
                    type: boolean
                type: object
          description: A successful response
        "400":
          description: A failure response
      tags:
        - Commands
  "/v1/commands/{id}/variables":
    get:
      description: Get a charge station's config variables
      operationId: getVariables
      parameters:
        - description: The chargestation id
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Returns Cs configurations array
      tags:
        - Commands
    patch:
      description: Update config variables for a chargestation
      operationId: patchChargeStationVariable
      parameters:
        - description: ID of charge station
          in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                value:
                  type: string
                variable:
                  enum:
                    - MeterValueSampleInterval
                    - HeartbeatInterval
                    - ConnectionTimeOut
                    - WebSocketPingInterval
                    - TransactionMessageRetryInterval
                    - TransactionMessageAttempts
                  type: string
              type: object
        description: Charge Station Variable to set
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                  ok:
                    type: boolean
                  result:
                    type: object
                type: object
          description: A successful response
        "400":
          description: A failure response
      tags:
        - Commands
  /v1/configurations:
    get:
      description: Get Configurations data
      operationId: getConfigurations
      parameters:
        - $ref: "#/components/parameters/paginate_limit1"
        - $ref: "#/components/parameters/paginate_page1"
        - $ref: "#/components/parameters/paginate_enabled1"
        - $ref: "#/components/parameters/sort_by1"
        - $ref: "#/components/parameters/sort_order1"
        - $ref: "#/components/parameters/parameter1"
        - $ref: "#/components/parameters/parameter2"
        - $ref: "#/components/parameters/parameter3"
        - $ref: "#/components/parameters/parameter4"
      responses:
        "200":
          description: Success
      tags:
        - Configurations
    post:
      description: Create connector with parameters
      operationId: postConfigurations
      requestBody:
        content:
          application/json:
            schema:
              properties:
                key:
                  type: string
                value:
                  type: string
              type: object
        description: Include Configuration properties to create here
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                  ok:
                    type: boolean
                  result:
                    type: object
                type: object
          description: A successful response
        "400":
          description: A failure response
      tags:
        - Configurations
  "/v1/configurations/{id}":
    get:
      description: Get one Configuration data
      operationId: getConfiguration
      parameters:
        - description: ID of Configuration that needs to be fetched
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
      tags:
        - Configurations
  /v1/connectors:
    get:
      description: List connectors
      operationId: getConnectors
      parameters:
        - $ref: "#/components/parameters/paginate_limit1"
        - $ref: "#/components/parameters/paginate_page1"
        - $ref: "#/components/parameters/paginate_enabled1"
        - $ref: "#/components/parameters/sort_by1"
        - $ref: "#/components/parameters/sort_order1"
        - $ref: "#/components/parameters/parameter1"
        - $ref: "#/components/parameters/parameter2"
        - $ref: "#/components/parameters/parameter3"
        - $ref: "#/components/parameters/parameter4"
        - $ref: "#/components/parameters/include_evse1"
        - $ref: "#/components/parameters/include_organization1"
        - $ref: "#/components/parameters/include_rate1"
      responses:
        "200":
          description: Returns an array of connector objects
      tags:
        - Connectors
    post:
      description: Create a new connector
      operationId: postConnectors
      requestBody:
        content:
          application/json:
            schema:
              properties:
                chargestation:
                  type: string
                format:
                  type: string
                power:
                  type: integer
                power_type:
                  type: string
                rate:
                  type: string
                type:
                  type: string
              type: object
        description: Include Connector properties to create here
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                  ok:
                    type: boolean
                  result:
                    type: object
                type: object
          description: Returns the new connector object
        "400":
          description: A failure response
      tags:
        - Connectors
  "/v1/connectors/{id}":
    delete:
      description: Delete a connector
      operationId: deleteConnector
      parameters:
        - description: The connector id that needs to be deleted
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Returns the deleted connector object
      tags:
        - Connectors
    get:
      description: Get a connector
      operationId: getConnector
      parameters:
        - description: ID of connector that needs to be fetched
          in: path
          name: id
          required: true
          schema:
            type: string
        - $ref: "#/components/parameters/include_evse1"
        - $ref: "#/components/parameters/include_organization1"
        - $ref: "#/components/parameters/include_rate1"
      responses:
        "200":
          description: Returns a connector object
      tags:
        - Connectors
    patch:
      description: Update a connector's data
      operationId: patchConnector
      parameters:
        - description: ID of connector that needs to be updated
          in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                chargestation:
                  type: string
                format:
                  type: string
                power:
                  type: integer
                power_type:
                  type: string
                rate:
                  type: string
                type:
                  type: string
              type: object
        description: Include connector properties to update here
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                  ok:
                    type: boolean
                  result:
                    type: object
                type: object
          description: Returns the updated connector object
        "400":
          description: A failure response
      tags:
        - Connectors
  /v1/drivers:
    get:
      description: List all drivers
      operationId: getDrivers
      parameters:
        - description: Get a list of active drivers
          in: query
          name: active
          schema:
            type: boolean
        - $ref: "#/components/parameters/paginate_limit1"
        - $ref: "#/components/parameters/paginate_page1"
        - $ref: "#/components/parameters/paginate_enabled1"
        - $ref: "#/components/parameters/sort_by1"
        - $ref: "#/components/parameters/sort_order1"
        - $ref: "#/components/parameters/parameter1"
        - $ref: "#/components/parameters/parameter2"
        - $ref: "#/components/parameters/parameter3"
        - $ref: "#/components/parameters/parameter4"
        - description: Populate tokens
          in: query
          name: include_tokens
          schema:
            type: boolean
        - description: Populate group
          in: query
          name: include_group
          schema:
            type: boolean
        - $ref: "#/components/parameters/include_organization1"
      responses:
        "200":
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                  ok:
                    type: boolean
                  result:
                    items: {}
                    type: array
                type: object
          description: Returns a list of driver objects
        "400":
          description: A failure response
      tags:
        - Drivers
    post:
      description: Create a new driver
      operationId: postDrivers
      requestBody:
        content:
          application/json:
            schema:
              properties:
                active:
                  default: true
                  type: boolean
                address:
                  properties:
                    city:
                      type: string
                    country:
                      type: string
                    postalCode:
                      type: string
                    streetAndNumber:
                      type: string
                  type: object
                email:
                  type: string
                firstname:
                  type: string
                lastname:
                  type: string
                phone:
                  properties:
                    home:
                      type: string
                    mobile:
                      type: string
                    work:
                      type: string
                  type: object
                source:
                  enum:
                    - physical
                    - slack
                    - telegram
                    - sms
                  type: string
              required:
                - firstname
                - lastname
                - source
              type: object
        description: Include driver properties to create here
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                  ok:
                    type: boolean
                  result:
                    type: object
                type: object
          description: Returns the newly created driver object
        "400":
          description: A failure response
      tags:
        - Drivers
  "/v1/drivers/{id}":
    delete:
      description: Delete a driver
      operationId: deleteDriver
      parameters:
        - description: The driver id that needs to be deleted
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Returns the deleted driver object
      tags:
        - Drivers
    get:
      description: Get a driver's data
      operationId: getDriver
      parameters:
        - description: The driver id that needs to be fetched
          in: path
          name: id
          required: true
          schema:
            type: string
        - description: Populate tokens
          in: query
          name: include_tokens
          schema:
            type: boolean
        - description: Populate group
          in: query
          name: include_group
          schema:
            type: boolean
        - description: Populate organization
          in: query
          name: include_organization
          schema:
            type: boolean
      responses:
        "200":
          description: Returns a driver object
      tags:
        - Drivers
    patch:
      description: Update a driver's data
      operationId: patchDriver
      parameters:
        - description: ID of driver that needs to be updated
          in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                active:
                  type: boolean
                address:
                  properties:
                    city:
                      type: string
                    country:
                      type: string
                    postalCode:
                      type: string
                    streetAndNumber:
                      type: string
                  type: object
                email:
                  type: string
                firstname:
                  type: string
                lastname:
                  type: string
                phone:
                  properties:
                    home:
                      type: string
                    mobile:
                      type: string
                    work:
                      type: string
                  type: object
                source:
                  type: string
                tokens:
                  items: {}
                  type: array
              type: object
        description: Include driver properties to create here
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                  ok:
                    type: boolean
                  result:
                    items: {}
                    type: array
                type: object
          description: Returns the updated driver object
        "400":
          description: A failure response
      tags:
        - Drivers
  "/v1/location/{id}":
    delete:
      description: Delete a location
      operationId: deleteLocation
      parameters:
        - description: The location id that needs to be deleted
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Returns the deleted location object
      tags:
        - Locations
    get:
      description: Get a location's data
      operationId: getLocation
      parameters:
        - description: The location id that needs to be fetched
          in: path
          name: id
          required: true
          schema:
            type: string
        - description: Populate chargestations
          in: query
          name: include_chargestations
          schema:
            type: boolean
        - description: Populate organization
          in: query
          name: include_organization
          schema:
            type: boolean
      responses:
        "200":
          description: Returns a location object
      tags:
        - Locations
    patch:
      description: Update a location's data
      operationId: patchLocation
      parameters:
        - description: ID of location that needs to be updated
          in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                active:
                  default: true
                  type: boolean
                address:
                  properties:
                    city:
                      type: string
                    country:
                      type: string
                    postalCode:
                      type: string
                    state:
                      type: string
                    streetAndNumber:
                      type: string
                  type: object
                chargestations:
                  items: {}
                  type: array
                coordinates:
                  properties:
                    latitude:
                      type: number
                    longitude:
                      type: number
                  type: object
                openingHours:
                  properties:
                    "0":
                      items:
                        properties:
                          endTime:
                            type: string
                          startTime:
                            type: string
                        type: object
                      type: array
                    "1":
                      items:
                        properties:
                          endTime:
                            type: string
                          startTime:
                            type: string
                        type: object
                      type: array
                    "2":
                      items:
                        properties:
                          endTime:
                            type: string
                          startTime:
                            type: string
                        type: object
                      type: array
                    "3":
                      items:
                        properties:
                          endTime:
                            type: string
                          startTime:
                            type: string
                        type: object
                      type: array
                    "4":
                      items:
                        properties:
                          endTime:
                            type: string
                          startTime:
                            type: string
                        type: object
                      type: array
                    "5":
                      items:
                        properties:
                          endTime:
                            type: string
                          startTime:
                            type: string
                        type: object
                      type: array
                    "6":
                      items:
                        properties:
                          endTime:
                            type: string
                          startTime:
                            type: string
                        type: object
                      type: array
                  type: object
                operatorName:
                  type: string
                timezone:
                  type: string
              type: object
        description: Include location properties to create here
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                  ok:
                    type: boolean
                  result:
                    items: {}
                    type: array
                type: object
          description: Returns the updated location object
        "400":
          description: A failure response
      tags:
        - Locations
  /v1/locations:
    get:
      description: Get Locations data
      operationId: getLocations
      parameters:
        - $ref: "#/components/parameters/paginate_limit1"
        - $ref: "#/components/parameters/paginate_page1"
        - $ref: "#/components/parameters/paginate_enabled1"
        - $ref: "#/components/parameters/sort_by1"
        - $ref: "#/components/parameters/sort_order1"
        - $ref: "#/components/parameters/parameter1"
        - $ref: "#/components/parameters/parameter2"
        - $ref: "#/components/parameters/parameter3"
        - $ref: "#/components/parameters/parameter4"
        - $ref: "#/components/parameters/include_organization1"
      responses:
        "200":
          description: Success
        "400":
          description: A failure response
      tags:
        - Locations
    post:
      description: Create a new location
      operationId: postLocations
      requestBody:
        content:
          application/json:
            schema:
              properties:
                active:
                  default: true
                  type: boolean
                address:
                  properties:
                    city:
                      type: string
                    country:
                      type: string
                    postalCode:
                      type: string
                    streetAndNumber:
                      type: string
                  type: object
                chargestations:
                  items: {}
                  type: array
                coordinates:
                  properties:
                    latitude:
                      type: number
                    longitude:
                      type: number
                  type: object
                operatorName:
                  type: string
              required:
                - operatorName
                - address
                - coordinates
              type: object
        description: Include location properties to create here
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                  ok:
                    type: boolean
                  result:
                    type: object
                type: object
          description: Returns the newly created location object
        "400":
          description: A failure response
      tags:
        - Locations
  /v1/organizations:
    get:
      description: Get an array of all Organizations
      operationId: getOrganizations
      parameters:
        - $ref: "#/components/parameters/paginate_limit1"
        - $ref: "#/components/parameters/paginate_page1"
        - $ref: "#/components/parameters/paginate_enabled1"
        - $ref: "#/components/parameters/sort_by1"
        - $ref: "#/components/parameters/sort_order1"
        - $ref: "#/components/parameters/parameter1"
        - $ref: "#/components/parameters/parameter2"
        - $ref: "#/components/parameters/parameter3"
        - $ref: "#/components/parameters/parameter4"
        - description: Populate locations
          in: query
          name: include_locations
          schema:
            type: boolean
      responses:
        "200":
          description: Returns an array of Organization Objects
      tags:
        - Organizations
  "/v1/organizations/{id}":
    get:
      description: Get one organization's data by id
      operationId: getOrganization
      parameters:
        - description: ID of organization that needs to be fetched
          in: path
          name: id
          required: true
          schema:
            type: string
        - description: Populate locations
          in: query
          name: include_locations
          schema:
            type: boolean
      responses:
        "200":
          description: Returns an Organization Object
      tags:
        - Organizations
    patch:
      description: Update an organization's data
      operationId: patchOrganization
      parameters:
        - description: ID of organization that needs to be updated
          in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                active:
                  type: boolean
                address:
                  properties:
                    city:
                      type: string
                    country:
                      type: string
                    postalCode:
                      type: string
                    streetAndNumber:
                      type: string
                  type: object
                channels:
                  properties:
                    slack:
                      type: object
                    telegram:
                      type: object
                  type: object
                configurations:
                  properties:
                    basicAuthEnabled:
                      type: boolean
                    basicAuthPassword:
                      type: boolean
                  type: object
                links:
                  properties:
                    about:
                      type: string
                    contact:
                      type: string
                    privacy:
                      type: string
                    support:
                      type: string
                  type: object
                locations:
                  items: {}
                  type: array
                logo:
                  type: string
                name:
                  type: string
                otp:
                  type: string
                stripe_connected_account_id:
                  type: string
                stripe_country:
                  type: string
                stripe_currency:
                  type: string
                stripe_reserve_amount:
                  type: integer
                support:
                  properties:
                    business_hours:
                      type: string
                    chat:
                      properties:
                        type:
                          type: string
                        value:
                          type: string
                      type: object
                    contact_number:
                      type: string
                    email:
                      type: string
                  type: object
                supportChat:
                  properties:
                    id:
                      type: string
                    name:
                      type: string
                  type: object
                theme:
                  properties:
                    colors:
                      properties:
                        primary:
                          type: string
                        secondary:
                          type: string
                      type: object
                  type: object
              type: object
        description: Include organization properties to create here
        required: true
      responses:
        "201":
          description: Returns the modified Organization Object
        "400":
          description: A failure response
      tags:
        - Organizations
  /v1/realtime:
    get:
      description: Use to request a Websockets handshake
      operationId: getRealtime
      parameters:
        - description: The JWT token to use for auth
          in: header
          name: sec-websocket-protocol
          required: true
          schema:
            type: string
      responses:
        "101":
          description: Upgrade connection
      tags:
        - Realtime
  /v1/reservations:
    get:
      description: Get Reservations data
      operationId: getReservations
      parameters:
        - $ref: "#/components/parameters/paginate_limit1"
        - $ref: "#/components/parameters/paginate_page1"
        - $ref: "#/components/parameters/paginate_enabled1"
        - $ref: "#/components/parameters/sort_by1"
        - $ref: "#/components/parameters/sort_order1"
        - $ref: "#/components/parameters/parameter1"
        - $ref: "#/components/parameters/parameter2"
        - $ref: "#/components/parameters/parameter3"
        - $ref: "#/components/parameters/parameter4"
        - $ref: "#/components/parameters/include_chargestation1"
        - $ref: "#/components/parameters/include_organization1"
      responses:
        "200":
          description: Success
      tags:
        - Reservations
  "/v1/reservations/{id}":
    get:
      description: Get one reservation data
      operationId: getReservation
      parameters:
        - description: ID of the reservation that needs to be fetched
          in: path
          name: id
          required: true
          schema:
            type: string
        - description: Populate chargestation
          in: query
          name: include_chargestation
          schema:
            type: boolean
        - description: Populate organization
          in: query
          name: include_organization
          schema:
            type: boolean
      responses:
        "200":
          description: Success
      tags:
        - Reservations
    patch:
      description: Use to request a update an existing reservation. The request will wait for the charge station to process the command. It will timeout after 60 seconds.
      operationId: updatereservation
      parameters:
        - description: ID of the reservation that needs to be fetched
          in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                connector:
                  minimum: 1
                  type: integer
                driver:
                  type: string
                endDate:
                  type: string
                evse:
                  minimum: 1
                  type: integer
              type: object
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                  ok:
                    type: boolean
                  result:
                    type: object
                type: object
          description: A successful response
        "400":
          description: A failure response
      tags:
        - Reservations
  /v1/tokens:
    get:
      description: List tokens
      operationId: getTokens
      parameters:
        - $ref: "#/components/parameters/paginate_limit1"
        - $ref: "#/components/parameters/paginate_page1"
        - $ref: "#/components/parameters/paginate_enabled1"
        - $ref: "#/components/parameters/sort_by1"
        - $ref: "#/components/parameters/sort_order1"
        - $ref: "#/components/parameters/parameter1"
        - $ref: "#/components/parameters/parameter2"
        - $ref: "#/components/parameters/parameter3"
        - $ref: "#/components/parameters/parameter4"
        - $ref: "#/components/parameters/include_driver1"
        - $ref: "#/components/parameters/include_organization1"
      responses:
        "200":
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                  ok:
                    type: boolean
                  result:
                    items: {}
                    type: array
                type: object
          description: Returns an array of token objects
        "401":
          description: A failure response
      tags:
        - Tokens
    post:
      description: Create a new token
      operationId: postTokens
      requestBody:
        content:
          application/json:
            schema:
              properties:
                active:
                  default: true
                  type: boolean
                channel:
                  enum:
                    - physical
                    - slack
                    - telegram
                    - sms
                  type: string
                driver:
                  type: string
                physicalId:
                  type: string
                type:
                  type: string
              required:
                - active
                - physicalId
                - driver
                - channel
              type: object
        description: Include token properties to create here
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                  ok:
                    type: boolean
                  result:
                    items: {}
                    type: array
                type: object
          description: Returns a newly created token object
        "400":
          description: A failure response
      tags:
        - Tokens
  "/v1/tokens/{id}":
    delete:
      description: Use to delete a token
      operationId: deleteToken
      parameters:
        - description: The token id that needs to be deleted
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Returns the deleted token object
      tags:
        - Tokens
    get:
      description: Get a single token's data
      operationId: getToken
      parameters:
        - description: The token id that needs to be fetched
          in: path
          name: id
          required: true
          schema:
            type: string
        - description: Populate driver
          in: query
          name: include_driver
          schema:
            type: boolean
        - description: Populate organization
          in: query
          name: include_organization
          schema:
            type: boolean
      responses:
        "200":
          description: Returns a token object
      tags:
        - Tokens
    patch:
      description: Update a token
      operationId: patchToken
      parameters:
        - description: ID of token that needs to be updated
          in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                active:
                  default: true
                  type: boolean
                channel:
                  enum:
                    - physical
                    - slack
                    - telegram
                    - sms
                  type: string
                driver:
                  type: string
                physicalId:
                  type: string
                type:
                  type: string
              type: object
        description: Include token properties to create here
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                  ok:
                    type: boolean
                  result:
                    items: {}
                    type: array
                type: object
          description: Returns the updated token
        "400":
          description: A failure response
      tags:
        - Tokens
  /v1/transactions:
    get:
      description: Get a list of transactions
      operationId: getTransactions
      parameters:
        - description: Started to get only active transactions
          in: query
          name: status
          schema:
            enum:
              - Started
              - Ended
            type: string
        - $ref: "#/components/parameters/paginate_limit1"
        - $ref: "#/components/parameters/paginate_page1"
        - $ref: "#/components/parameters/paginate_enabled1"
        - $ref: "#/components/parameters/sort_by1"
        - $ref: "#/components/parameters/sort_order1"
        - $ref: "#/components/parameters/parameter1"
        - $ref: "#/components/parameters/parameter2"
        - $ref: "#/components/parameters/parameter3"
        - $ref: "#/components/parameters/parameter4"
        - $ref: "#/components/parameters/include_chargestation1"
        - $ref: "#/components/parameters/include_evse1"
        - $ref: "#/components/parameters/include_connector1"
        - $ref: "#/components/parameters/include_driver1"
        - $ref: "#/components/parameters/include_token1"
        - $ref: "#/components/parameters/include_reservation1"
        - $ref: "#/components/parameters/include_organization1"
        - $ref: "#/components/parameters/include_rate1"
      responses:
        "200":
          content:
            application/json:
              schema:
                properties:
                  hasNext:
                    type: boolean
                  hasPrevious:
                    type: boolean
                  message:
                    type: string
                  ok:
                    type: boolean
                  result:
                    items: {}
                    type: array
                type: object
          description: Returns an array of transaction objects
        "400":
          description: Not Found
      tags:
        - Transactions
  "/v1/transactions/{id}":
    get:
      description: Get a specific transaction
      operationId: getTransaction
      parameters:
        - description: The transaction id that needs to be fetched
          in: path
          name: id
          required: true
          schema:
            type: string
        - $ref: "#/components/parameters/include_chargestation1"
        - $ref: "#/components/parameters/include_evse1"
        - $ref: "#/components/parameters/include_connector1"
        - $ref: "#/components/parameters/include_driver1"
        - $ref: "#/components/parameters/include_token1"
        - $ref: "#/components/parameters/include_reservation1"
        - $ref: "#/components/parameters/include_organization1"
        - $ref: "#/components/parameters/include_rate1"
      responses:
        "200":
          description: Returns a transaction object
        "401":
          description: Not Found
      tags:
        - Transactions
  "/v1/transactions/{id}/cost":
    get:
      description: Get a specific transaction's cost
      operationId: getTransactionCost
      parameters:
        - description: The transaction id that needs to be fetched
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Returns a transaction's cost object
        "401":
          description: Not Found
      tags:
        - Transactions
  /v1/vehicles:
    get:
      description: List all vehicles
      operationId: getVehicles
      parameters:
        - description: Get a list of active vehicles
          in: query
          name: active
          schema:
            type: boolean
        - $ref: "#/components/parameters/paginate_limit1"
        - $ref: "#/components/parameters/paginate_page1"
        - $ref: "#/components/parameters/paginate_enabled1"
        - $ref: "#/components/parameters/sort_by1"
        - $ref: "#/components/parameters/sort_order1"
        - $ref: "#/components/parameters/parameter1"
        - $ref: "#/components/parameters/parameter2"
        - $ref: "#/components/parameters/parameter3"
        - $ref: "#/components/parameters/parameter4"
        - $ref: "#/components/parameters/include_driver1"
        - $ref: "#/components/parameters/include_token1"
        - $ref: "#/components/parameters/include_organization1"
      responses:
        "200":
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                  ok:
                    type: boolean
                  result:
                    items: {}
                    type: array
                type: object
          description: Returns a list of vehicle objects
        "400":
          description: A failure response
      tags:
        - Vehicles
  "/v1/vehicles/{id}":
    get:
      description: Get a vehicle's data
      operationId: getVehicle
      parameters:
        - description: The vehicule id that needs to be fetched
          in: path
          name: id
          required: true
          schema:
            type: string
        - $ref: "#/components/parameters/include_driver1"
        - $ref: "#/components/parameters/include_token1"
        - $ref: "#/components/parameters/include_organization1"
      responses:
        "200":
          description: Returns a vehicle object
      tags:
        - Vehicles
  "/v1/vehicles/{id}/battery":
    get:
      description: Get a vehicle's battery
      operationId: getVehicleBattery
      parameters:
        - description: The vehicle id that needs to be fetched
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Returns a vehicle object
      tags:
        - Vehicles
  "/v1/vehicles/{id}/charge":
    get:
      description: Get a vehicle's charge
      operationId: getVehicleCharge
      parameters:
        - description: The vehicle id that needs to be fetched
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Returns a vehicle object
      tags:
        - Vehicles
    post:
      description: Change charge
      operationId: postCharge
      parameters:
        - description: The vehicle id that needs to be fetched
          in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                action:
                  enum:
                    - START
                    - STOP
                  type: string
              required:
                - action
              type: object
        description: Include command properties to send here
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                  ok:
                    type: boolean
                  result:
                    type: object
                type: object
          description: Returns the status of the command
        "400":
          description: A failure response
      tags:
        - Vehicles
  "/v1/vehicles/{id}/location":
    get:
      description: Get a vehicle's location
      operationId: getVehicleLocation
      parameters:
        - description: The vehicle id that needs to be fetched
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Returns a vehicle object
      tags:
        - Vehicles
  "/v1/vehicles/{id}/odometer":
    get:
      description: Get a vehicle's odometer
      operationId: getVehicleOdometer
      parameters:
        - description: The vehicle id that needs to be fetched
          in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Returns a vehicle object
      tags:
        - Vehicles
components:
  parameters:
    include_chargestation1:
      description: Populate chargestation
      in: query
      name: include_chargestation
      schema:
        type: boolean
    include_connector1:
      description: Populate connector
      in: query
      name: include_connector
      schema:
        type: boolean
    include_driver1:
      description: Populate driver
      in: query
      name: include_driver
      schema:
        type: boolean
    include_evse1:
      description: Populate evse
      in: query
      name: include_evse
      schema:
        type: boolean
    include_organization1:
      description: Populate organization
      in: query
      name: include_organization
      schema:
        type: boolean
    include_rate1:
      description: Populate rate
      in: query
      name: include_rate
      schema:
        type: boolean
    include_reservation1:
      description: Populate reservation
      in: query
      name: include_reservation
      schema:
        type: boolean
    include_token1:
      description: Populate token
      in: query
      name: include_token
      schema:
        type: boolean
    paginate_enabled1:
      description: Enable pagination
      in: query
      name: paginate_enabled
      schema:
        default: true
        type: boolean
    paginate_limit1:
      description: Number of results per page
      in: query
      name: paginate_limit
      schema:
        default: 20
        maximum: 1000
        minimum: 1
        type: integer
    paginate_page1:
      description: The queried page index
      in: query
      name: paginate_page
      schema:
        type: string
    parameter1:
      description: Date as ISO String
      in: query
      name: createdAt[$gte]
      schema:
        format: date-time
        type: string
    parameter2:
      description: Date as ISO String
      in: query
      name: createdAt[$lte]
      schema:
        format: date-time
        type: string
    parameter3:
      description: Date as ISO String
      in: query
      name: updatedAt[$gte]
      schema:
        format: date-time
        type: string
    parameter4:
      description: Date as ISO String
      in: query
      name: updatedAt[$lte]
      schema:
        format: date-time
        type: string
    sort_by1:
      description: Sort data by this key
      in: query
      name: sort_by
      schema:
        default: createdAt
        type: string
    sort_order1:
      description: asc to sort ascending (default is desc - descending)
      in: query
      name: sort_order
      schema:
        default: desc
        enum:
          - desc
          - asc
        type: string
  schemas:
    schema1:
      properties:
        location:
          type: string
        manufacturer:
          type: string
        model:
          type: string
        protocol:
          type: string
        public:
          type: boolean
      type: object
  securitySchemes:
    oauth2:
      flows:
        implicit:
          authorizationUrl: https://auth.edrv.io/authorize
          scopes:
            read:chargestations: Read chargestations
            read:chargestations/:id: Read a chargestation
            read:chargestations/:id/connectors: Read connectors for a chargestation
            read:connectors: Read connectors
            read:connectors/:id: Read a connector
            read:drivers: Read drivers
            read:drivers/:id: Read a driver
            read:locations: Read locations
            read:locations/:id: Read a location
            read:organizations: Read organizations
            read:organizations/:id: Read an organization
            read:realtime: Read realtime
            read:reservations: Read reservations
            read:reservations/:id: Read a reservations
            read:stats/:asset/:statistic: Read a statistic
            read:tokens: Read tokens
            read:tokens/:id: Read a token
            read:transactions: Read transactions
            read:transactions/:id: Read a transaction
            write:chargestations: Write chargestations
            write:chargestations/:id: Write a chargestation
            write:commands/remotestart: Write remotestart for commands
            write:commands/remotestop: Write remotestop for commands
            write:commands/reserve: Write reserve for commands
            write:commands/reset: Write reset for commands
            write:commands/unlockconnector: Write unlockconnector for commands
            write:connectors: Write connectors
            write:connectors/:id: Write a connector
            write:drivers: Write drivers
            write:drivers/:id: Write a driver
            write:locations: Write locations
            write:locations/:id: Write a location
            write:organizations: Write organizations
            write:organizations/:id: Writen an organization
            write:reservations: Write reservations
            write:reservations/:id: Write a reservation
            write:tokens: Write tokens
            write:tokens/:id: Write a token
            write:transactions: Write transactions
            write:transactions/:id: Write a transactions
      type: oauth2
x-explorer-enabled: true
x-github-repo: rsafaya-edrv/edrv-api
x-github-sha: 2df8793f7607c6d41b7c8c4c552d6423896000ca
x-proxy-enabled: true
x-samples-enabled: true
x-samples-languages:
  - curl
  - node
  - ruby
  - javascript
  - python
x-si-base: /home/runner/work/edrv-api/edrv-api/swagger.yml
