Skip to main content

Pleevi API (0.1.0)

Download OpenAPI specification:Download

Pleevi Support: hi@pleevi.ai URL: https://pleevi.ai/

Measurements and Transactions

Create a new measurement

Create a new measurement. If possible consider relying on our MQTT broker to send measurements.

Authorizations:
OAuth2ClientCredentialsHTTPBearer
Request Body schema: application/json
required
site_id
required
string (Site Id)
asset_id
required
string (Asset Id)
timestamp
required
string <date-time> (Timestamp)
energyValue
required
number (Energyvalue)
powerValue
required
number (Powervalue)
required
object (Pins)

Responses

Request samples

Content type
application/json
{
  • "site_id": "string",
  • "asset_id": "string",
  • "timestamp": "2019-08-24T14:15:22Z",
  • "energyValue": 0,
  • "powerValue": 0,
  • "pins": {
    }
}

Response samples

Content type
application/json
{
  • "_id": "5eb7cf5a86d9755df3a6c593",
  • "timestamp": "2019-08-24T14:15:22Z",
  • "source": {
    },
  • "energyValue": 0,
  • "powerValue": 0,
  • "pins": {
    },
  • "received_at": "2019-08-24T14:15:22Z"
}

Create a new transaction

Create a new transaction. If possible consider relying on our MQTT broker to send transactions.

Authorizations:
OAuth2ClientCredentialsHTTPBearer
Request Body schema: application/json
required
site_id
required
string (Site Id)
assetId
required
string (Assetid)
transactionId
required
string (Transactionid)

A unique identifier that should pe provided for each transaction

timestamp
required
string <date-time> (Timestamp)
transactionState
required
string (TransactionState)
Enum: "Started" "Updated" "SuspendedEV" "Ended"
startTime
required
string <date-time> (Starttime)
Stoptime (string) or Stoptime (null) (Stoptime)
Nochargingphases (string) or Nochargingphases (null) (Nochargingphases)
required
Array of Usedchargingpins (strings) or Usedchargingpins (null) (Usedchargingpins)
required
Maxpower (number) or Maxpower (null) (Maxpower)
smartCharging
boolean (Smartcharging)
Default: true
requestedMinEnergy
required
integer (Requestedminenergy)
requestedMaxEnergy
required
integer (Requestedmaxenergy)
Estimateddeparturetime (string) or Estimateddeparturetime (null) (Estimateddeparturetime)
priority
required
integer (Priority) [ 0 .. 10 ]
category
string (Category)
Default: "default"

Responses

Request samples

Content type
application/json
{
  • "site_id": "string",
  • "assetId": "string",
  • "transactionId": "string",
  • "timestamp": "2019-08-24T14:15:22Z",
  • "transactionState": "Started",
  • "startTime": "2019-08-24T14:15:22Z",
  • "stopTime": "2019-08-24T14:15:22Z",
  • "noChargingPhases": "string",
  • "usedChargingPins": [
    ],
  • "maxPower": 0,
  • "smartCharging": true,
  • "requestedMinEnergy": 0,
  • "requestedMaxEnergy": 0,
  • "estimatedDepartureTime": "2019-08-24T14:15:22Z",
  • "priority": 10,
  • "category": "default"
}

Response samples

Content type
application/json
{
  • "_id": "5eb7cf5a86d9755df3a6c593",
  • "site_id": "string",
  • "assetId": "string",
  • "transactionId": "string",
  • "timestamp": "2019-08-24T14:15:22Z",
  • "transactionState": "Started",
  • "startTime": "2019-08-24T14:15:22Z",
  • "stopTime": "2019-08-24T14:15:22Z",
  • "noChargingPhases": "string",
  • "usedChargingPins": [
    ],
  • "maxPower": 0,
  • "smartCharging": true,
  • "requestedMinEnergy": 0,
  • "requestedMaxEnergy": 0,
  • "estimatedDepartureTime": "2019-08-24T14:15:22Z",
  • "priority": 10,
  • "category": "default",
  • "received_at": "2019-08-24T14:15:22Z",
  • "partner_id": "string"
}

Sites

Get all sites

Fetch a list of all existing sites

Authorizations:
OAuth2ClientCredentialsHTTPBearer

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create site

Create a new site. In general it's a good idea to first creat a site without any configuration and then add the configuration separately. This allows us to validate the site based on measurement data when adding the configuration.

Authorizations:
OAuth2ClientCredentialsHTTPBearer
Request Body schema: application/json
required
site_id
required
string (Site Id) ^[a-zA-Z0-9_-]{1,64}$
name
required
string (Name)
required
object (Location)
country
required
string (Country)
active
boolean (Active)
Default: false
Configurations (object) or null

Responses

Request samples

Content type
application/json
{
  • "site_id": "string",
  • "name": "string",
  • "location": {
    },
  • "country": "string",
  • "active": false,
  • "configurations": {
    }
}

Response samples

Content type
application/json
{
  • "_id": "5eb7cf5a86d9755df3a6c593",
  • "partner_id": "string",
  • "site_id": "string",
  • "name": "string",
  • "location": {
    },
  • "country": "string",
  • "active": false,
  • "validation_status": {
    },
  • "configurations": {
    },
  • "connections": {
    }
}

Get site

Fetch details of a specific site using its site_id

Authorizations:
OAuth2ClientCredentialsHTTPBearer
path Parameters
site_id
required
string (Site Id)

Responses

Response samples

Content type
application/json
{
  • "_id": "5eb7cf5a86d9755df3a6c593",
  • "partner_id": "string",
  • "site_id": "string",
  • "name": "string",
  • "location": {
    },
  • "country": "string",
  • "active": false,
  • "validation_status": {
    },
  • "configurations": {
    },
  • "connections": {
    }
}

Patch site

Partially update a site by its site_id, modifying only specified fields

Authorizations:
OAuth2ClientCredentialsHTTPBearer
path Parameters
site_id
required
string (Site Id)
Request Body schema: application/json
required
property name*
additional property
any

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "_id": "5eb7cf5a86d9755df3a6c593",
  • "partner_id": "string",
  • "site_id": "string",
  • "name": "string",
  • "location": {
    },
  • "country": "string",
  • "active": false,
  • "validation_status": {
    },
  • "configurations": {
    },
  • "connections": {
    }
}

Replace site

Replace the entire site data by its site_id

Authorizations:
OAuth2ClientCredentialsHTTPBearer
path Parameters
site_id
required
string (Site Id)
Request Body schema: application/json
required
site_id
required
string (Site Id) ^[a-zA-Z0-9_-]{1,64}$
name
required
string (Name)
required
object (Location)
country
required
string (Country)
Configurations (object) or null
ValidationStatus (object) or null

Responses

Request samples

Content type
application/json
{
  • "site_id": "string",
  • "name": "string",
  • "location": {
    },
  • "country": "string",
  • "configurations": {
    },
  • "validation_status": {
    }
}

Response samples

Content type
application/json
{
  • "_id": "5eb7cf5a86d9755df3a6c593",
  • "partner_id": "string",
  • "site_id": "string",
  • "name": "string",
  • "location": {
    },
  • "country": "string",
  • "active": false,
  • "validation_status": {
    },
  • "configurations": {
    },
  • "connections": {
    }
}

Delete site

Remove a site from the system using its site_id. This is not reversible. The measurements and transactions linked to this site wont be deleted. If you afterwards re-create a site with the same site_id it will match with the old measurements and transactions.

Authorizations:
OAuth2ClientCredentialsHTTPBearer
path Parameters
site_id
required
string (Site Id)

Responses

Response samples

Content type
application/json
null

Validate site

Revalidate a site and return the site with the updated validation information.

Authorizations:
OAuth2ClientCredentialsHTTPBearer
path Parameters
site_id
required
string (Site Id)

Responses

Response samples

Content type
application/json
{
  • "_id": "5eb7cf5a86d9755df3a6c593",
  • "partner_id": "string",
  • "site_id": "string",
  • "name": "string",
  • "location": {
    },
  • "country": "string",
  • "active": false,
  • "validation_status": {
    },
  • "configurations": {
    },
  • "connections": {
    }
}

Activate site

Activate a site

Authorizations:
OAuth2ClientCredentialsHTTPBearer
path Parameters
site_id
required
string (Site Id)

Responses

Response samples

Content type
application/json
{
  • "_id": "5eb7cf5a86d9755df3a6c593",
  • "partner_id": "string",
  • "site_id": "string",
  • "name": "string",
  • "location": {
    },
  • "country": "string",
  • "active": false,
  • "validation_status": {
    },
  • "configurations": {
    },
  • "connections": {
    }
}

Deactivate site

Deactivate a site

Authorizations:
OAuth2ClientCredentialsHTTPBearer
path Parameters
site_id
required
string (Site Id)

Responses

Response samples

Content type
application/json
{
  • "_id": "5eb7cf5a86d9755df3a6c593",
  • "partner_id": "string",
  • "site_id": "string",
  • "name": "string",
  • "location": {
    },
  • "country": "string",
  • "active": false,
  • "validation_status": {
    },
  • "configurations": {
    },
  • "connections": {
    }
}

Add or update site configuration

Add or modify the configuration (both site-configuration and optimization configuration) for a specific site using its site_id. First create a site with a POST call (see above) and then add the configurations.

Authorizations:
OAuth2ClientCredentialsHTTPBearer
path Parameters
site_id
required
string (Site Id)
Request Body schema: application/json
SiteConfiguration (object) or null
OptmizationConfiguration (object) or null

Responses

Request samples

Content type
application/json
{
  • "site_configuration": {
    },
  • "optimization_configuration": {
    }
}

Response samples

Content type
application/json
{
  • "_id": "5eb7cf5a86d9755df3a6c593",
  • "partner_id": "string",
  • "site_id": "string",
  • "name": "string",
  • "location": {
    },
  • "country": "string",
  • "active": false,
  • "validation_status": {
    },
  • "configurations": {
    },
  • "connections": {
    }
}

Authentication

Get OAuth2 access token

Authenticate a client using basic credentials to obtain an OAuth2 access token.

Authorizations:
HTTPBasic
Request Body schema: application/x-www-form-urlencoded
grant_type
string (Grant Type) client_credentials

Responses

Response samples

Content type
application/json
{
  • "token_type": "bearer",
  • "access_token": "string",
  • "type": "partner_access",
  • "expires_in": 0
}

Optimizations

Retrieve the latest optimization for a site

Retrieve the latest optimization for a site

Authorizations:
OAuth2ClientCredentialsHTTPBearer
path Parameters
site_id
required
string (Site Id)
query Parameters
required
Timestamp (string) or Timestamp (null) (Timestamp)

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Retrieve the optimized energy schedule for a site at a specific time.

Retrieve the optimized energy schedule for a site at a specific time.

Authorizations:
OAuth2ClientCredentialsHTTPBearer
path Parameters
site_id
required
string (Site Id)
required
At Time (string) or At Time (null) (At Time)

Responses

Response samples

Content type
application/json
{
  • "_id": "5eb7cf5a86d9755df3a6c593",
  • "siteId": "string",
  • "partner_id": "string",
  • "timestamp": "2019-08-24T14:15:22Z",
  • "schedules": [
    ]
}