LaylaElectric (v1)

Download OpenAPI specification:Download

users

User management

Get currently logged-in user

Authorizations:
JWT

Responses

Response samples

Content type
application/json
{
  • "picture_preview_url": "string",
  • "name": "string",
  • "accepted_policy": 0,
  • "email": "string",
  • "address": "string",
  • "phone": "string",
  • "company": "string",
  • "title": "string",
  • "preferences": {
    },
  • "notification_preferences": {
    }
}

Update currently logged-in user

Authorizations:
JWT
Request Body schema: application/json
picture_url
string
name
required
string
accepted_policy
integer
email
string
address
required
string
phone
string
company
string
title
string
object
object

Responses

Request samples

Content type
application/json
{
  • "picture_url": "string",
  • "name": "string",
  • "accepted_policy": 0,
  • "email": "string",
  • "address": "string",
  • "phone": "string",
  • "company": "string",
  • "title": "string",
  • "preferences": {
    },
  • "notification_preferences": {
    }
}

Response samples

Content type
application/json
{
  • "picture_preview_url": "string",
  • "name": "string",
  • "accepted_policy": 0,
  • "email": "string",
  • "address": "string",
  • "phone": "string",
  • "company": "string",
  • "title": "string",
  • "preferences": {
    },
  • "notification_preferences": {
    }
}

Patch (update partially) currently logged-in user

Authorizations:
JWT
Request Body schema: application/json
picture_url
string

Should be obtained from 'POST /api/v1/users/self/picture/upload_urls'

name
string
accepted_policy
integer
email
string
address
string
phone
string
company
string
title
string
object
object

Responses

Request samples

Content type
application/json
{
  • "picture_url": "string",
  • "name": "string",
  • "accepted_policy": 0,
  • "email": "string",
  • "address": "string",
  • "phone": "string",
  • "company": "string",
  • "title": "string",
  • "preferences": {
    },
  • "notification_preferences": {
    }
}

Response samples

Content type
application/json
{
  • "picture_preview_url": "string",
  • "name": "string",
  • "accepted_policy": 0,
  • "email": "string",
  • "address": "string",
  • "phone": "string",
  • "company": "string",
  • "title": "string",
  • "preferences": {
    },
  • "notification_preferences": {
    }
}

Update FCM token

Authorizations:
JWT
Request Body schema: application/json
fcm_token
string

Responses

Request samples

Content type
application/json
{
  • "fcm_token": "string"
}

Upload new FCM token

Authorizations:
JWT
Request Body schema: application/json
fcm_token
string

Responses

Request samples

Content type
application/json
{
  • "fcm_token": "string"
}

Delete FCM token

Authorizations:
JWT
query Parameters
fcm_token
string

FCM token to delete for a logged-in user

Responses

Create signed URL for upload to AWS S3

Authorizations:
JWT
Request Body schema: application/json
content_type
string

Responses

Request samples

Content type
application/json
{
  • "content_type": "string"
}

Response samples

Content type
application/json
{
  • "signed_url": "string",
  • "url": "string"
}

properties

Property management

List properties for current (logged-in) user

Authorizations:
JWT
query Parameters
id
string

ID of the specific property

currency
string (CurrencyCode)
Enum: "USD" "EUR" "GBP" "ILS" "BRL"
fields
Array of strings
Items Enum: "users" "alarm_event_counts" "monthly_savings" "total_savings" "total_efficiency_gains" "alarm_states" "devices"

Comma-separated list of additional fields to be included into response

filters
Array of strings
Items Enum: "eco" "noise_alarm" "security_alarm"

Comma-separated list of filters that should be applied to filter out properties

sort_by
string

Sorting by parameter

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create a new property

Authorizations:
JWT
Request Body schema: application/json
name
required
string
category
required
string
Enum: "house" "apartment" "office" "commercial"
address
required
string
timezone
required
string
object
enabled
boolean

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "category": "house",
  • "address": "string",
  • "timezone": "string",
  • "settings": {
    },
  • "enabled": true
}

Response samples

Content type
application/json
{
  • "role": "admin",
  • "enabled_alarms": [
    ],
  • "enabled_features": [
    ],
  • "alarm_event_counts": [
    ],
  • "monthly_savings": {
    },
  • "total_savings": {
    },
  • "total_efficiency_gains": 0,
  • "users": [
    ],
  • "alarm_states": [
    ],
  • "name": "string",
  • "category": "house",
  • "address": "string",
  • "timezone": "string",
  • "settings": {
    },
  • "enabled": true
}

Update a property

Authorizations:
JWT
path Parameters
id
required
string
Request Body schema: application/json
name
required
string
category
required
string
Enum: "house" "apartment" "office" "commercial"
address
required
string
timezone
required
string
object
enabled
boolean

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "category": "house",
  • "address": "string",
  • "timezone": "string",
  • "settings": {
    },
  • "enabled": true
}

Response samples

Content type
application/json
{
  • "role": "admin",
  • "enabled_alarms": [
    ],
  • "enabled_features": [
    ],
  • "alarm_event_counts": [
    ],
  • "monthly_savings": {
    },
  • "total_savings": {
    },
  • "total_efficiency_gains": 0,
  • "users": [
    ],
  • "alarm_states": [
    ],
  • "name": "string",
  • "category": "house",
  • "address": "string",
  • "timezone": "string",
  • "settings": {
    },
  • "enabled": true
}

Patch (update partially) a property

Authorizations:
JWT
path Parameters
id
required
string
Request Body schema: application/json
name
string
category
string
Enum: "house" "apartment" "office" "commercial"
address
string
timezone
string
object
enabled
boolean

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "category": "house",
  • "address": "string",
  • "timezone": "string",
  • "settings": {
    },
  • "enabled": true
}

Response samples

Content type
application/json
{
  • "role": "admin",
  • "enabled_alarms": [
    ],
  • "enabled_features": [
    ],
  • "alarm_event_counts": [
    ],
  • "monthly_savings": {
    },
  • "total_savings": {
    },
  • "total_efficiency_gains": 0,
  • "users": [
    ],
  • "alarm_states": [
    ],
  • "name": "string",
  • "category": "house",
  • "address": "string",
  • "timezone": "string",
  • "settings": {
    },
  • "enabled": true
}

Delete a property

Authorizations:
JWT
path Parameters
id
required
string

Responses

Activate/Deactivate a property alarms

Authorizations:
JWT
path Parameters
id
required
string
query Parameters
noise_alarm
boolean
noise_alarm_quiet_hours
boolean
occupancy_alarm
boolean
occupancy_alarm_quiet_hours
boolean
security_alarm
boolean

Responses

Activate/Deactivate a property eco mode

Authorizations:
JWT
path Parameters
id
required
string
query Parameters
eco_mode
boolean

Responses

Get property measurements

Authorizations:
JWT
path Parameters
id
required
string
query Parameters
measure
required
string (MeasureName)
Enum: "power" "energy" "noise" "occupancy_min" "occupancy_max" "humidity" "temperature" "wifi_rssi" "net_qlt" "aq_iaq" "pir_movement_count" "mold_risk_index" "energy_index" "probe_req_count" "probe_scan_count" "pres" "aq_eco2" "aq_etoh" "aq_tvoc" "aq_rel_iaq"
granularity
string (TimeGranularity)
Enum: "minutes" "15min" "30min" "hours" "3hours" "days" "months" "years"
start
string <date-time> (start date-time in ISO format (without timezone, timezone is taken from the device property) (inclusive))
end
string <date-time> (end date-time in ISO format (without timezone, timezone is taken from the device property) (exclusive))
device_ids
Array of strings

Optional comma-separated list of device IDs to limit the property aggregation to

Responses

Response samples

Content type
application/json
[
  • {
    }
]

devices

Device management

List devices for current (logged-in) user

Authorizations:
JWT
query Parameters
fields
Array of strings
Items Enum: "alarm_event_counts" "latest_values" "in_alarm" "snoozed" "active_alarms"

Comma-separated list of additional fields to be included into response

property_id
required
string

The ID of the property to receive the devices for. This is required by the current API implementation.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create a new device (register)

Authorizations:
JWT
Request Body schema: application/json
property_id
required
string
device_mac
required
string
category
required
string
Value: "SP"
name
required
string
enabled
boolean
Array of objects (Alarms configuration)
features
Array of strings
Items Value: "eco"
object (DeviceSettingsModel)

Responses

Request samples

Content type
application/json
{
  • "property_id": "string",
  • "device_mac": "string",
  • "category": "SP",
  • "name": "string",
  • "enabled": true,
  • "alarms": [
    ],
  • "features": [
    ],
  • "settings": {
    }
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "property_id": "string",
  • "alarm_event_counts": [
    ],
  • "latest_values": [
    ],
  • "in_alarm": [
    ],
  • "snoozed": [
    ],
  • "active_alarms": [
    ],
  • "device_mac": "string",
  • "category": "SP",
  • "name": "string",
  • "enabled": true,
  • "alarms": [
    ],
  • "features": [
    ],
  • "settings": {
    }
}

Get device details

Authorizations:
JWT
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "property_id": "string",
  • "alarm_event_counts": [
    ],
  • "latest_values": [
    ],
  • "in_alarm": [
    ],
  • "snoozed": [
    ],
  • "active_alarms": [
    ],
  • "device_mac": "string",
  • "category": "SP",
  • "name": "string",
  • "enabled": true,
  • "alarms": [
    ],
  • "features": [
    ],
  • "settings": {
    }
}

Patch (update partially) a device

Authorizations:
JWT
path Parameters
id
required
string
Request Body schema: application/json
device_mac
string
category
string
Value: "SP"
name
string
enabled
boolean
Array of objects (Alarms configuration)
features
Array of strings
Items Value: "eco"
object (DeviceSettingsModel)

Responses

Request samples

Content type
application/json
{
  • "device_mac": "string",
  • "category": "SP",
  • "name": "string",
  • "enabled": true,
  • "alarms": [
    ],
  • "features": [
    ],
  • "settings": {
    }
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "property_id": "string",
  • "alarm_event_counts": [
    ],
  • "latest_values": [
    ],
  • "in_alarm": [
    ],
  • "snoozed": [
    ],
  • "active_alarms": [
    ],
  • "device_mac": "string",
  • "category": "SP",
  • "name": "string",
  • "enabled": true,
  • "alarms": [
    ],
  • "features": [
    ],
  • "settings": {
    }
}

Delete a device

Authorizations:
JWT
path Parameters
id
required
string

Responses

Get device measurements

Authorizations:
JWT
path Parameters
id
required
string
query Parameters
measure
required
string (MeasureName)
Enum: "power" "energy" "noise" "occupancy_min" "occupancy_max" "humidity" "temperature" "wifi_rssi" "net_qlt" "aq_iaq" "pir_movement_count" "mold_risk_index" "energy_index" "probe_req_count" "probe_scan_count" "pres" "aq_eco2" "aq_etoh" "aq_tvoc" "aq_rel_iaq"
granularity
string (TimeGranularity)
Enum: "minutes" "15min" "30min" "hours" "3hours" "days" "months" "years"
start
string <date-time> (start date-time in ISO format (without timezone, timezone is taken from the device property) (inclusive))
end
string <date-time> (end date-time in ISO format (without timezone, timezone is taken from the device property) (exclusive))

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Snooze an alarm

Authorizations:
JWT
path Parameters
id
required
string

device id

name
required
string

alarm name

Request Body schema: application/json
duration
string
Enum: "30min" "60min"

Responses

Request samples

Content type
application/json
{
  • "duration": "30min"
}

Start IR learning process

Authorizations:
JWT
path Parameters
id
required
string

device id

Responses

Saving IR learning results

Authorizations:
JWT
path Parameters
id
required
string

device id

Responses

Cancel IR learning process

Authorizations:
JWT
path Parameters
id
required
string

device id

Responses

Test IR mode

Authorizations:
JWT
path Parameters
id
required
string

device id

Request Body schema: application/json
mode
required
string
Enum: "smart" "learn"
object (DeviceIrApplianceConfigModel)

Responses

Request samples

Content type
application/json
{
  • "mode": "smart",
  • "appliance_config": {
    }
}

Check whether IR learning has been completed for a device

Authorizations:
JWT
path Parameters
id
required
string

device id

Responses

Response samples

Content type
application/json
{
  • "is_learned": true
}

Create or update a smart AC timer

Authorizations:
JWT
path Parameters
id
required
string

device id

Request Body schema: application/json
action
required
string
Enum: "on" "off"
scheduled_for
required
string <date-time>

Must include a timezone offset

Responses

Request samples

Content type
application/json
{
  • "action": "on",
  • "scheduled_for": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
{
  • "timer": {
    }
}

Remove a smart AC timer

Authorizations:
JWT
path Parameters
id
required
string

device id

Responses

Response samples

Content type
application/json
{
  • "timer": {
    }
}

Get device shadow metadata

Authorizations:
JWT
path Parameters
id
required
string

device id

Responses

Response samples

Content type
application/json
{
  • "device_id": "string",
  • "device_mac": "string",
  • "last_PIR_detected_time_th": "string",
  • "message": "string"
}

statistics

Various statistics

Get statistics

Authorizations:
JWT
query Parameters
category
string

category of property (can be acquired from property API)

period
string
Enum: "day" "two_days" "week" "month" "three_months" "year"
currency
string (CurrencyCode)
Enum: "USD" "EUR" "GBP" "ILS" "BRL"
property_id
string
device_id
string
fields
Array of strings
Items Value: "trends"

Comma-separated list of additional fields to be included into response

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Savings temporal breakdown

Authorizations:
JWT
query Parameters
category
string

property category

property_ids
Array of strings

Comma-separated list of property ids

device_ids
Array of strings

Comma-separated list of device ids

start
string <date-time>
end
string <date-time>
timezone
string
granularity
string (TimeGranularity)
Enum: "minutes" "15min" "30min" "hours" "3hours" "days" "months" "years"
currency
string (CurrencyCode)
Enum: "USD" "EUR" "GBP" "ILS" "BRL"

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Savings summary

Authorizations:
JWT
query Parameters
category
string

property category

property_ids
Array of strings

Comma-separated list of property ids

device_ids
Array of strings

Comma-separated list of device ids

start
string <date-time>
end
string <date-time>
timezone
string
currency
string (CurrencyCode)
Enum: "USD" "EUR" "GBP" "ILS" "BRL"

Responses

Response samples

Content type
application/json
{
  • "energy": 0,
  • "costs": 0,
  • "co2": 0,
  • "trees": 0
}

Alarm events temporal breakdown

Authorizations:
JWT
path Parameters
name
required
string

event name

query Parameters
category
string

property category

property_ids
Array of strings

Comma-separated list of property ids

device_ids
Array of strings

Comma-separated list of device ids

start
string <date-time>
end
string <date-time>
timezone
string
granularity
string (TimeGranularity)
Enum: "minutes" "15min" "30min" "hours" "3hours" "days" "months" "years"

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Alarm events summary

Authorizations:
JWT
path Parameters
name
required
string

alarm name

query Parameters
category
string

property category

property_ids
Array of strings

Comma-separated list of property ids

device_ids
Array of strings

Comma-separated list of device ids

start
string <date-time>
end
string <date-time>
timezone
string

Responses

Response samples

Content type
application/json
{
  • "value": 0
}

Alarm events summary by property

Authorizations:
JWT
path Parameters
name
required
string

alarm name

query Parameters
category
string

property category

property_ids
Array of strings

Comma-separated list of property ids

device_ids
Array of strings

Comma-separated list of device ids

start
string <date-time>
end
string <date-time>
timezone
string

Responses

Response samples

Content type
application/json
{
  • "value": 0,
  • "property": {
    }
}

Alarm events summary by property

Authorizations:
JWT
query Parameters
names
Array of strings (AlarmName)
Items Enum: "noise_alarm" "noise_alarm_quiet_hours" "occupancy_alarm" "device_off_alarm" "device_off_alarm_multiple" "security_alarm" "mold_alarm" "smoke_alarm" "co_alarm"

alarm names

category
string

property category

property_ids
Array of strings

Comma-separated list of property ids

device_ids
Array of strings

Comma-separated list of device ids

start
string <date-time>
end
string <date-time>
timezone
string

Responses

Response samples

Content type
application/json
{
  • "value": 0,
  • "name": "noise_alarm",
  • "property": {
    }
}

Savings temporal breakdown

Authorizations:
JWT
query Parameters
category
string

property category

property_ids
Array of strings

Comma-separated list of property ids

device_ids
Array of strings

Comma-separated list of device ids

start
string <date-time>
end
string <date-time>
timezone
string
granularity
string (TimeGranularity)
Enum: "minutes" "15min" "30min" "hours" "3hours" "days" "months" "years"
currency
string (CurrencyCode)
Enum: "USD" "EUR" "GBP" "ILS" "BRL"

Responses

Response samples

Content type
application/json
[
  • {
    }
]

summary

Authorizations:
JWT
query Parameters
category
string

property category

property_ids
Array of strings

Comma-separated list of property ids

device_ids
Array of strings

Comma-separated list of device ids

start
string <date-time>
end
string <date-time>
timezone
string
currency
string (CurrencyCode)
Enum: "USD" "EUR" "GBP" "ILS" "BRL"

Responses

Response samples

Content type
application/json
{
  • "value": 0
}

categories

List categories

Authorizations:
JWT

Responses

Response samples

Content type
application/json
[
  • {
    }
]

contact us

Submit contact us email

Authorizations:
JWT
query Parameters
email
required
string

User email

first_name
required
string

User first name

last_name
required
string

User last name

Responses

Response samples

Content type
application/json
[
  • {
    }
]

property members

List property members

Authorizations:
JWT
query Parameters
property_ids
Array of strings

Comma-separated list of property ids

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Assign property members

Authorizations:
JWT
query Parameters
property_ids
Array of strings

Comma-separated list of property ids

user_id
string

The ID of the user to be assigned to properties

full_name
string

The full_name of the user to be assigned to properties

email
string

The email of the user to be assigned to properties

role
string
Enum: "admin" "user"

The email of the user to be assigned to properties

Responses

Set properties for member

Authorizations:
JWT
query Parameters
property_ids
Array of strings

Comma-separated list of property ids

user_id
string

The ID of the user to be assigned to properties

full_name
string

The full_name of the user to be assigned to properties

email
string

The email of the user to be assigned to properties

role
string
Enum: "admin" "user"

The email of the user to be assigned to properties

Responses

Delete property members

Authorizations:
JWT
query Parameters
property_ids
Array of strings

Comma-separated list of property ids

user_id
string

The ID of the user to be assigned to properties

email
string

The email of the user to be assigned to properties

Responses

List invited property members

Authorizations:
JWT
query Parameters
property_ids
Array of strings

Comma-separated list of property ids

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Set for member

Authorizations:
JWT
query Parameters
property_ids
Array of strings

Comma-separated list of property ids

user_id
string

The ID of the user to be assigned to properties

email
string

The email of the user to be assigned to properties

role
string
Enum: "admin" "user"

The email of the user to be assigned to properties

Responses

sensor requests

Create a new sensor request

Authorizations:
JWT
Request Body schema: application/json
property_id
string
property_name
string
sensors_count
required
number
country
string
city
string
street
string
apartment
string

Responses

Request samples

Content type
application/json
{
  • "property_id": "string",
  • "property_name": "string",
  • "sensors_count": 0,
  • "country": "string",
  • "city": "string",
  • "street": "string",
  • "apartment": "string"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "property_id": "string",
  • "property_name": "string",
  • "sensors_count": 0,
  • "country": "string",
  • "city": "string",
  • "street": "string",
  • "apartment": "string",
  • "created_at": "2019-08-24T14:15:22Z"
}

reports

Create a new report request

Authorizations:
JWT
Request Body schema: application/json
property_ids
Array of strings
types
Array of strings
Items Enum: "owner" "smoke" "noise" "executive"
period
required
string
Enum: "day" "two_days" "week" "month" "three_months" "year" "all_time"

Responses

Request samples

Content type
application/json
{
  • "property_ids": [
    ],
  • "types": [
    ],
  • "period": "day"
}

settings

Retrieve the alarm setting

Authorizations:
JWT

Responses

Response samples

Content type
application/json
{
  • "type": "noise",
  • "value": {
    }
}

notifications

Get notifications

Authorizations:
JWT
query Parameters
property_id
string
seen
boolean
types
Array of strings (NotificationTypeName)
Items Enum: "noise_alarm_start" "noise_alarm_end" "noise_alarm_quiet_hours_start" "noise_alarm_quiet_hours_end" "occupancy_alarm_start" "occupancy_alarm_end" "device_off_alarm_start" "device_off_alarm_end" "device_off_alarm_multiple_start" "device_off_alarm_multiple_end" "security_alarm_start" "security_alarm_end" "mold_alarm_start" "mold_alarm_end" "smoke_alarm_start" "smoke_alarm_end" "co_alarm_start" "co_alarm_end" "eco_mode_enabled"
start
string <date-time>
end
string <date-time>
timezone
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get latest notifications by property

Authorizations:
JWT
query Parameters
property_ids
Array of strings
types
Array of strings (NotificationTypeName)
Items Enum: "noise_alarm_start" "noise_alarm_end" "noise_alarm_quiet_hours_start" "noise_alarm_quiet_hours_end" "occupancy_alarm_start" "occupancy_alarm_end" "device_off_alarm_start" "device_off_alarm_end" "device_off_alarm_multiple_start" "device_off_alarm_multiple_end" "security_alarm_start" "security_alarm_end" "mold_alarm_start" "mold_alarm_end" "smoke_alarm_start" "smoke_alarm_end" "co_alarm_start" "co_alarm_end" "eco_mode_enabled"
start
string <date-time>
timezone
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Delete multiple (batch) notifications

Authorizations:
JWT
Request Body schema: application/json
ids
Array of strings (notification ids)

particular notifications to delete

property_id
string (property id)

all notifications from the property will be deleted

Responses

Request samples

Content type
application/json
{
  • "ids": [
    ],
  • "property_id": "string"
}

Mark notification(s) as seen for the user

Authorizations:
JWT
Request Body schema: application/json
ids
Array of strings (notification ids)

particular notifications to mark as seen

property_id
string (property id)

all notifications from the property will be marked as seen

Responses

Request samples

Content type
application/json
{
  • "ids": [
    ],
  • "property_id": "string"
}

Delete a notification

Authorizations:
JWT
path Parameters
id
required
string

notification id

Responses