Skip to main content

Pleevi API (0.1.0)

Download OpenAPI specification:Download

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

Sites

Create site

Create a new site. In general it's a good idea to first create 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 all sites

Fetch a list of all existing sites

Authorizations:
OAuth2ClientCredentialsHTTPBearer
query Parameters
After (string) or After (null) (After)
page_size
integer (Page Size) [ 1 .. 100 ]
Default: 20

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "page_size": 0,
  • "end_cursor": "string",
  • "has_next_page": false
}

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,
  • "user": {
    }
}

Optimizations

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

If at_time is not provided, the latest schedule will be returned. If no schedule is found, an empty schedule will be returned.

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": [
    ]
}

Profiles

Create profile

Create a new profile. Profiles are used to configure default values for a transaction. For example, you can set a default requested max energy or a default estimated departure time. For more information, see the Guide on profiles.

Authorizations:
OAuth2ClientCredentialsHTTPBearer
Request Body schema: application/json
required
profile_id
required
string (Profile Id)
site_id
required
string (Site Id)
Description (string) or Description (null) (Description)
default_estimated_departure_time_delta
required
string <duration> (Default Estimated Departure Time Delta)
default_requested_min_energy
required
integer (Default Requested Min Energy)
default_requested_max_energy
required
integer (Default Requested Max Energy)

Responses

Request samples

Content type
application/json
{
  • "profile_id": "string",
  • "site_id": "string",
  • "description": "string",
  • "default_estimated_departure_time_delta": "string",
  • "default_requested_min_energy": 0,
  • "default_requested_max_energy": 0
}

Response samples

Content type
application/json
{
  • "profile_id": "string",
  • "site_id": "string",
  • "description": "string",
  • "default_estimated_departure_time_delta": "string",
  • "default_requested_min_energy": 0,
  • "default_requested_max_energy": 0
}

List profiles

Fetch a paginated list of profiles. For more information, see the Guide on profiles.

Authorizations:
OAuth2ClientCredentialsHTTPBearer
path Parameters
site_id
required
string (Site Id)
query Parameters
After (string) or After (null) (After)
page_size
integer (Page Size) [ 1 .. 100 ]
Default: 20

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "page_size": 0,
  • "end_cursor": "string",
  • "has_next_page": false
}

Get profile

Fetch details of a specific profile by its profile_id. For more information, see the Guide on profiles.

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

Responses

Response samples

Content type
application/json
{
  • "profile_id": "string",
  • "site_id": "string",
  • "description": "string",
  • "default_estimated_departure_time_delta": "string",
  • "default_requested_min_energy": 0,
  • "default_requested_max_energy": 0
}

Update profile

Partially update a profile by its profile_id. For more information, see the Guide on profiles.

Authorizations:
OAuth2ClientCredentialsHTTPBearer
path Parameters
profile_id
required
string (Profile Id)
site_id
required
string (Site Id)
Request Body schema: application/json
required
Description (string) or Description (null) (Description)
Default Estimated Departure Time Delta (string) or Default Estimated Departure Time Delta (null) (Default Estimated Departure Time Delta)
Default Requested Min Energy (integer) or Default Requested Min Energy (null) (Default Requested Min Energy)
Default Requested Max Energy (integer) or Default Requested Max Energy (null) (Default Requested Max Energy)

Responses

Request samples

Content type
application/json
{
  • "description": "string",
  • "default_estimated_departure_time_delta": "string",
  • "default_requested_min_energy": 0,
  • "default_requested_max_energy": 0
}

Response samples

Content type
application/json
{
  • "profile_id": "string",
  • "site_id": "string",
  • "description": "string",
  • "default_estimated_departure_time_delta": "string",
  • "default_requested_min_energy": 0,
  • "default_requested_max_energy": 0
}

Delete profile

Remove a profile by its profile_id (irreversible). For more information, see the Guide on profiles.

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

Responses

Response samples

Content type
application/json
{
  • "status_code": 0,
  • "message": "string"
}