Relayr Cloud API Reference

Introduction

What is the relayr Cloud?

The relayr Cloud is a computing platform designed for industrial IoT. It is a managed multi-tenant environment available on one of relayr's infrastructure partners.

The different endpoints offered by the relayr Cloud can be used to build your own solutions or to integrate the relayr Cloud with your existing solutions or other relayr technology products (Dashboards, Analytics and Gateway solutions). This website lists all of the Cloud endpoints and explains how to use them.

Architecture

The relayr Cloud architecture revolves around devices, which are the most basic elements of the platform. Devices are entities that can transmit and receive data to and from the Cloud. They represent a machine, or any other industrial asset connected to the Cloud.

The data sent and received to and from the Cloud is then represented as measurement and alert values you can leverage according to your use case, using the different Cloud endpoints. User services also allow you to control who can access the Cloud services used in your solution. Browse the left navigation panel of this website to get a complete overview of the Cloud features.

Versioning

The relayr API is usually updated at each release and follows the below rules:

  • No breaking change is ever introduced.
  • New endpoints may be added.
  • Deprecated endpoints are removed on a specified date.

Errors

The relayr API uses standard HTTP status codes to indicate the success or failure of a call. The body of the response is a JSON in the following format:

{
  "error": {
    "id": "e75ec4f4772ebdcc5c73f50cda9a8a78",
    "message": "Old password is not valid",
    "details": "More about what a valid password looks like",
    "code": "PASSWORD_MALFORMED"
  }
}

The error fields code and details are optional and not always present.

Important information

Rate limits

The numbers in the table below indicate the number of requests you can send to the Cloud per second per IP.

Rate limit Burst limit
Login endpoints 25 50
All other endpoints 25 50

NOTE: If you try to login and fail 5 times in a row within an hour, your account gets blocked for 5 mins even if you haven’t reached 50 requests.

Get started

Requirements

Authorization

  • Relayr credentials:
    • User name
    • Password
    • Organization
  • Access token or API key. More information on how to acquire an access token or create an API key is available under Cloud Access in the left navigation panel.

Tools

Tokens

NOTE: The request URL for these endpoints is: https://login.relayr.io/.

The relayr Cloud uses OAuth 2.0 as its main authorization protocol. Your relayr credentials (user name, password and organization) are required to acquire the following tokens:

  • Access tokens, valid for 100 minutes
  • Refresh tokens, valid for 15 years

Tokens are used in the authorization header when sending API calls to the Cloud, as follows: Authorization: Bearer <token>. The endpoints presented in this section allow you to acquire and manage access and refresh tokens for the Cloud and/or your websites connected to the Cloud.

Change your password

Changes the password you are currently using. You must acquire a new access token after the change.

Authorizations:
Request Body schema: application/json

New and Old Password

oldPassword
required
string

Password has to be at least 8 characters long and contain at least one uppercase, one lowercase letter and a number

password
required
string

Password has to be at least 8 characters long and contain at least one uppercase, one lowercase letter and a number

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Acquire a refresh token

Acquires a refresh token for the Cloud or the website specified in the query. Use "api-client" for the client_id parameter to acquire a refresh token for the Cloud. Refresh tokens are valid for 15 years.

query Parameters
client_id
required
string^[A-Za-z0-9_.-]+$
Example: client_id=asset-services-dashboard

ID of the website that the user wants to log into.

Request Body schema:
refresh_token
required
string

Responses

Request samples

Content type
{
}

Response samples

Content type
application/json
{
}

Delete multiple tokens

Deletes the access tokens and refresh tokens specified in the query

Authorizations:
Request Body schema: application/json
access_token
string

Access token

refresh_token
string

Refresh token

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Acquire an access token

Acquires an access token for the Cloud or the website specified in the query from scripts, SDKs and backend services. Use "api-client" for the client_id parameter to acquire an access token for the Cloud. Access tokens are valid for 100 minutes. This endpoint is not allowed to be called in browsers (enforced using CORS). If you want to authorize a frontend application, use the form of the /oauth/authorize endpoint on this service.

query Parameters
client_id
required
string^[A-Za-z0-9_.-]+$
Example: client_id=asset-services-dashboard

ID of the website that the user wants to log into.

Request Body schema:
username
required
string

Must be url encoded

password
required
string

Must be url encoded

Responses

Request samples

Content type
{
}

Response samples

Content type
application/json
{
}

Return your information

Returns the information associated with the token you are currently using, such as the organizations to which you belong, the device groups to which you have access in the Cloud, etc.

Authorizations:

Responses

Response samples

Content type
application/json
{
}

API Keys

The relayr Cloud lets you create API keys as an alternative way to access the Cloud. API keys are used in the following header when making calls to the Cloud: X-Api-Key: <api-key>. The endpoints presented in this section allow you to create and manage API keys.

As there is no concept of Api-key permissions in the relayr cloud. When using Api-key caller will get exactly the same permissions as the user that has created the Api-key. Permissions will be resolved at the moment of the call. This means that if the role of the user that created the key gets updated or changed, a caller that uses api-key will get an updated list of permissions.

Return all API keys

Returns all your API keys

Authorizations:

Responses

Response samples

Content type
application/json
{
}

Create an API key

Creates an API key for the Cloud

Authorizations:
Request Body schema: application/json
name
string

Name of the API key for humans, can be used as description

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Delete an API key

Deletes the API key specified in the path

Authorizations:
path Parameters
keyId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: 86eb2cfe-5f9a-4459-9011-009c35e47fb5

Id of the API key

Responses

Response samples

Content type
application/json
{
}

Return an API key

Returns the API key specified in the path

Authorizations:
path Parameters
keyId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: 86eb2cfe-5f9a-4459-9011-009c35e47fb5

Id of the API key

Responses

Response samples

Content type
application/json
{
}

Frontend Login

NOTE: The request URL for these endpoints is: https://login.relayr.io/.

The relayr Cloud provides endpoints to create website pages for user authorization. Pages can be branded according to your use case. The endpoints presented in this section allow you to create website pages where logged in users can send invitations to a website to other users, users can accept invitations to different platforms and create and reset their passwords.

Display a login page

Displays an HTML login page for the website specified in the query. The page allows users to enter a user name and password.

query Parameters
client_id
required
string^[A-Za-z0-9_.-]+$
Example: client_id=asset-services-dashboard

ID of the website that the user wants to log into.

redirect_uri
string
Example: redirect_uri=https://asset-services.relayr.io

URL to redirect to after logging in. If not provided, a default one (if specified) is used.

org
string^[A-Za-z0-9_\s]+$
Example: org=ase

Organization to prefill. The organization field is then hidden and not shown in the form. Also a custom branding for the login page can be loaded if the organization is provided.

Responses

Response samples

Content type
application/json
{
}

Validate a login

Validates the information provided in the form used in oauth/authorize and in case of success, provides the user with a token for the website specified in the query and redirects them to it. In case of error, the form is shown again.

query Parameters
client_id
required
string^[A-Za-z0-9_.-]+$
Example: client_id=asset-services-dashboard

ID of the website that the user wants to log into.

redirect_uri
string
Example: redirect_uri=https://asset-services.relayr.io

URL to redirect to after logging in. If not provided, a default one (if specified) is used.

org
string^[A-Za-z0-9_\s]+$
Example: org=ase

Organization to prefill. The organization field is then hidden and not shown in the form. Also a custom branding for the login page can be loaded if the organization is provided.

Request Body schema: application/x-www-form-urlencoded
username
required
string
password
required
string
org
string
Deprecated

Organization used for generating the token.

Responses

Response samples

Content type
application/json
{
}

Display a page to change password

Displays an HTML page allowing users to enter a new password, for the website specified in the query.

query Parameters
client_id
required
string^[A-Za-z0-9_.-]+$
Example: client_id=asset-services-dashboard

ID of the website that the user wants to log into.

code
required
string^[A-Za-z0-9_.-]+$
Example: code=xertdw1234

Code which is used to change the password

Responses

Response samples

Content type
application/json
{
}

Validate a password change

Resets the password of the user and sends them an email informing them of the password change

query Parameters
redirect_uri
string
Example: redirect_uri=https://login.relayr.io/user/settings

URL to include in the email sent after user finished with the password change process. If not provided, a default one (if specified) is used.

Request Body schema:
code
required
string >= 8 characters
newPassword
required
string >= 8 characters

Responses

Request samples

Content type
{
}

Response samples

Content type
application/json
{
}

Send a temporary password

Sends a temporary password by email to the user, that can be used for a single login and change of the password.

query Parameters
client_id
required
string^[A-Za-z0-9_.-]+$
Example: client_id=asset-services-dashboard

ID of the website that the user wants to log into.

redirect_uri
string
Example: redirect_uri=https://login.relayr.io/password/change

URL to include in the email to send to the user to reset the password. If not provided, a default one (if specified) is used.

Request Body schema:
username
required
string <email> >= 4 characters

Username for login (email) used to validate the account and to send an email with the temporary password (if username exists). Must be url encoded.

Responses

Request samples

Content type
{
}

Response samples

Content type
application/json
{
}

Display a page to accept invitations

Displays an HTML page allowing new users to enter a password and accept the invitation, for the website specified in the query.

query Parameters
client_id
required
string^[A-Za-z0-9_.-]+$
Example: client_id=asset-services-dashboard

ID of the website that the user wants to log into.

redirect_uri
required
string
Example: redirect_uri=https://login.relayr.io/user/settings

URL to include in the email sent after user is finished with the password change process. If not provided, a default one (if specified) is used.

code
required
string^[A-Za-z0-9_.-]+$
Example: code=xertdw1234

Code which is used to change the password

Responses

Response samples

Content type
application/json
{
}

Set up a user

Sets the password of the user and activates them on the website specified in the query. The user also receives a welcome email and is redirected to the website.

query Parameters
client_id
required
string^[A-Za-z0-9_.-]+$
Example: client_id=asset-services-dashboard

ID of the website that the user wants to log into.

redirect_uri
string
Request Body schema:
code
required
string
password
required
string >= 8 characters
familyName
required
string non-empty
givenName
required
string non-empty
phoneNumber
string

Responses

Request samples

Content type
{
}

Response samples

Content type
application/json
{
}

MQTT Credentials - Device

The relayr Cloud supports the MQTT protocol for a variety of purposes. The endpoints presented in this section allow you to create and delete MQTT credentials for devices.

For more information on the MQTT topics available on the relayr MQTT broker, please go to our MQTT documentation website.

Delete MQTT credentials

Deletes the MQTT credentials for the device specified in the path

permissions: mqtt_credentials.write, mqtt_credentials.read

Authorizations:
path Parameters
deviceId
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: be3faaa1-6165-4439-93b8-ecfb8febc0b7

Id of the device for which to delete existing credentials

Responses

Response samples

Content type
application/json
{
}

Create or return MQTT credentials

Creates or returns the existing MQTT credentials for the device specified in the path

permissions: mqtt_credentials.write, mqtt_credentials.read, device.read

Authorizations:
path Parameters
deviceId
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: be3faaa1-6165-4439-93b8-ecfb8febc0b7

Id of the device for which to retrieve the credentials

Responses

Response samples

Content type
application/json
{
}

MQTT Credentials - Device Group

The relayr Cloud supports the MQTT protocol for a variety of purposes. The endpoints presented in this section allow you to create and delete MQTT credentials for device groups.

For more information on the MQTT topics available on the relayr MQTT broker, please go to our MQTT documentation website.

Delete MQTT credentials

Deletes the MQTT credentials for the device group specified in the path

permissions: mqtt_credentials.write, mqtt_credentials.read

Authorizations:
path Parameters
groupId
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: be3faaa1-6165-4439-93b8-ecfb8febc0b7

Id of the group for which to delete existing credentials

Responses

Response samples

Content type
application/json
{
}

Create or return MQTT credentials

Creates or returns the existing MQTT credentials for the device group specified in the path

permissions: mqtt_credentials.read, mqtt_credentials.write, device_group.read

Authorizations:
path Parameters
groupId
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: be3faaa1-6165-4439-93b8-ecfb8febc0b7

Id of the group for which to retrieve the credentials

Responses

Response samples

Content type
application/json
{
}

Device Models

Device models are entities which enable the relayr Cloud to make sense of the data received and transmitted by your devices. They essentially provide the semantics of the data to display.

A device model has a name and a description, while the actual information on the data a device can send/receive is defined in a version of a device model. Creating a device model and a device model version is hence your first step to create a device.

The endpoints presented in this section let you create and manage device models and their versions.

Return all device models

Returns all device models to which you have access

permissions: device_model.read

Authorizations:
query Parameters
fileModelId
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: fileModelId=a9eb4f33-4538-49a1-b6bf-b9c363502cda

file model id to filter for

limit
string [ 1 .. 100 ] ^\d+$
Example: limit=10

pagination limit - max number of entities to return

offset
string >= 0 ^\d+$
Example: offset=20

pagination offset

Responses

Response samples

Content type
application/json
{
}

Create a device model

Creates a device model

permissions: device_model.write, device_model.read

Authorizations:
Request Body schema: application/json
name
required
string [ 1 .. 64 ] characters ^(?!\s*$).+
description
string <= 256 characters ^(?!\s*$).+

Description of the device model.

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Delete a device model

Deletes the device model specified in the path. The model must not be in use by any device.

permissions: device_model.write, device_model.read, device.read

Authorizations:
path Parameters
modelId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: cea19e58-a633-4963-b29c-31a990587a5f

Device model Id (UUID)

Responses

Response samples

Content type
application/json
{
}

Return a device model

Returns the device model specified in the path

permissions: device_model.read

Authorizations:
path Parameters
modelId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: cea19e58-a633-4963-b29c-31a990587a5f

Device model Id (UUID)

Responses

Response samples

Content type
application/json
{
}

Update a device model

Updates the information of the device model specified in the path

permissions: device_model.write, device_model.read

Authorizations:
path Parameters
modelId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: cea19e58-a633-4963-b29c-31a990587a5f

Device model Id (UUID)

Request Body schema: application/json
description
string <= 256 characters

Description for the device model.

name
string [ 1 .. 64 ] characters ^(?!\s*$).+

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Return all versions of a device model

Returns all versions of the device model specified in the path

permissions: device_model.read

Authorizations:
path Parameters
modelId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: cea19e58-a633-4963-b29c-31a990587a5f

Device model Id (UUID)

Responses

Response samples

Content type
application/json
{
}

Create a device model version

Creates a version for the device model specified in the path

permissions: device_model.write, device_model.read

Authorizations:
path Parameters
modelId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: cea19e58-a633-4963-b29c-31a990587a5f

Device model Id (UUID)

Request Body schema: application/json

Model version

Array of objects
Array of objects
description
string <= 256 characters

Description for the device model version.

fileModelIds
Array of strings <uuid> unique
Array of objects
Array of objects
metadata
object

Represantation of device model version metadata

name
string [ 1 .. 64 ] characters ^(?!\s*$).+

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Validate a device model version

Validates the versions of the device model specified in the path

permissions: device_model.write, device_model.read

Authorizations:
path Parameters
modelId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: cea19e58-a633-4963-b29c-31a990587a5f

Device model Id (UUID)

Request Body schema: application/json

Model version to validate

Array of objects
Array of objects
description
string <= 256 characters

Description for the device model version.

fileModelIds
Array of strings <uuid> unique
Array of objects
Array of objects
metadata
object

Represantation of device model version metadata

name
string [ 1 .. 64 ] characters ^(?!\s*$).+

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Return a device model version

Returns the model version specified in the path of the device model specified in the path

permissions: device_model.read

Authorizations:
path Parameters
modelId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: cea19e58-a633-4963-b29c-31a990587a5f

Device model Id (UUID)

versionNumber
required
string^\d+$
Example: 1

Model version number as integer

Responses

Response samples

Content type
application/json
{
}

Update a device model version

Updates the model version specified in the path of the device model specified in the path

permissions: device_model.write, device_model.read

Authorizations:
path Parameters
modelId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: cea19e58-a633-4963-b29c-31a990587a5f

Device model Id (UUID)

versionNumber
required
string^\d+$
Example: 1

Model version number as integer

Request Body schema: application/json

Model version update

description
string <= 256 characters

Description for the device model version.

name
string [ 1 .. 64 ] characters ^(?!\s*$).+

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Devices

Devices constitute the most basic element of the relayr platform. Devices are entities that can transmit and receive data to and from the Cloud. They represent any piece of virtual or physical equipment capable of connecting to the relayr Cloud as defined below:

  • Physical equipment: piece of physical hardware, such as a single-board computer (e.g., the Raspberry Pi), a sensor or an actuator.
  • Virtual equipment: program running locally on a computer that sends and receives data to and from the relayr Cloud.

The data sent and received to and from the Cloud is then represented as measurement and alert values. The endpoints presented in this section let you create and manage devices.

NOTE: Before creating a device, you must create a device model and at least one device model version. Go to Device Models in the left navigation panel for more information on device models and their versions.

Update the model version of all devices in a device group

Updates the model version of all devices in the device group specified in the query. Note: all devices in the device-group, direct and indirect, are going to be updated.

permissions: device.write, device.read, device_model.read, device_group.read
Authorizations:
query Parameters
deviceGroupId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: deviceGroupId=ecbbb77d-b91c-4a33-989d-2d072bb59b68

Device group id

modelId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: modelId=ecbbb77d-b91c-4a33-989d-2d072bb59b68

Model id

Request Body schema: application/json
modelVersion
integer >= 1

Version of the specified model

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Create a device

Creates a device in the device groups specified in the query

permissions: device.write, device.read, device_model.read, device_group.read, device_group.write

Authorizations:
Request Body schema: application/json
name
required
string <= 64 characters ^(?!\s*$).+

Name of the device

modelId
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

The model ID of the device

modelVersion
required
integer >= 1

Version of the specified model

deviceGroupIds
required
Array of strings

List of groups that device should be included in

externalId
string <= 64 characters Nullable

A customer-provided identifier for the device. This allows the customer to assign a meaningful ID, such as a serial number, to the device. The External ID must be unique within the organization.

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Check if a device exists

Checks if the device corresponding to the specified ID exists in your organization.

permissions: device.read

Authorizations:
query Parameters
externalId
required
string <= 64 characters Nullable
Example: externalId=ncaeonio2232!@E!@Ddlk

A customer-provided identifier for the device. This allows the customer to assign a meaningful ID, such as a serial number, to the device. The External ID must be unique within the organization.

Responses

Response samples

Content type
application/json
{
}

Check user permissions for devices

Check if user has permissions for the devices specified in the path

permissions: device.read

Authorizations:
query Parameters
ids
required
Array of strings <uuid> [ 1 .. 50 ] items

List of device IDs (maximum 50)

Responses

Response samples

Content type
application/json
{
}

Search for devices (AND)

Searches for devices matching ALL the parameters specified in the query. If no parameter is specified, all the devices you have access to are returned. For example: if you specify deviceName: foo and city: berlin, this endpoint returns you all devices that are called foo and are located in berlin.

permissions: device.read, device_model.read, device_group.read, location.read, live_data.read, file_model.read

Authorizations:
query Parameters
limit
integer [ 1 .. 1000 ]
Default: 10

Pagination limit - maximum number of entities to return

offset
integer [ 0 .. 10000 ]
Default: 0

Pagination offset. offset + limit can not be bigger than the max value configured per setup (default is 10000)

locationbox
boolean
Default: false

If true, the response contains a locationBox field. It's an object with four coordinates which describe boundaries of the area where the devices are located.

groupdata
boolean
Default: false

If true, the response contains a deviceGroups.metadata field which has the metadata of each group the device belongs to

Request Body schema: application/json

Search query.

address
string

Case-insensitive, wildcards (*) accepted. Usually a street and a house number the device is located at

object

If defined, only devices with at least one alert set fulfilling severity restrictions will be returned. To enforce all device's set alerts needs to fulfilling severity restrictions set specifiedSeveritiesOnly=true. If more than one property is defined the set of acceptable values is generated for each of them and the intersection of the sets is used for filtering. For example for min = 2 (set of acceptable values [2, 3, 4, 5, 6, 7]), max = 5 (set of acceptable values [0, 1, 2, 3, 4, 5]) and values = [1, 3, 5, 7] the devices with at least one alert with severity equal 3 or 5 are returned

alertsState
any

A JSON object. The keys correspond to the alert names keys (e.g. ‘too_hot’, ‘too_slow’). The corresponding value is a string describing alert state {‘set‘, ‘clear‘, ‘*‘}. Key is case-sensitive, accepts wildcards (*). Value is case-insensitive, accepts wildcards (*). Alert states can be negated with ‘!’. E.g. { "*": "!set" } matches all devices which don't have any alert with state "set". { "foo*": "!set" } matches all devices which don't have any alert like "foo*" with state "set". If the device doesn't have an alert like "foo*" or no alerts at all it also matches. { "*": "!*" } matches all devices which don't have any alerts.

city
string

Case-insensitive, wildcards (*) accepted. The city the device is located in

country
string

Case-insensitive, wildcards (*) accepted. The country the device is located in

object

A JSON that allows filtering the date time. The keys correspond to the comparison operators < <= > >=

deviceId
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...

Case-insensitive, NO wildcards. The ID of the device

deviceModelName
string

Case-insensitive, wildcards (*) accepted. Name of the device model

deviceName
string

Case-insensitive, wildcards (*) accepted. The name of the device

directGroupId
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...

Case-insensitive, NO wildcards. The ID of the device group the device belongs to directly

externalId
string

Case-insensitive, wildcards (*) accepted. The external identifier of the device

fileModelId
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...

Case-insensitive, NO wildcards. The ID of the device's file model

object

Filters device records based on the given file model version and negate boolean flag.

fileModelVersionScheduled
integer

Experimental feature: Filter device records based on the given device file model version scheduled.

groupId
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...

Case-insensitive, NO wildcards. The ID of the device group the device belongs to

groupModelId
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...

Case-insensitive, NO wildcards. The ID of the device group model of the device group the device belongs to

groupModelName
string

Case-insensitive, wildcards (*) accepted. Name of the device group model of the device group the device belongs to

groupName
string

Case-insensitive, wildcards (*) accepted. Name of the device group the device belongs to

object

A JSON that allows filtering of last activity. The last activity field keeps track of when the cloud last received a measurement or alert from the device. The keys correspond to the comparison operators < <= > >= and notSet true/false which filters devices that never had activity.

object

The coordinates which describe boundaries of the area where the devices are located.

mapBoxFeature
string

Case-sensitive, NO wildcards. MapBox based representation of the location

metadata
any

A JSON object consisting of metadata. The keys correspond to the metadata keys (e.g. ‘color’, ‘smoothness’). The corresponding value can be a string, number or boolean. Key is case-sensitive. String value is case-insensitive, accepts wildcards (*).

modelId
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...

Case-insensitive, NO wildcards. The ID of the device model

zipCode
string

Case-insensitive, wildcards (*) accepted. The postal/zip code of the location

Array of objects

Sorting definition

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Search for devices (OR)

Searches for devices matching one OR several parameters specified in the query. If no parameter is specified, all the devices you have access to are returned.

permissions: device.read, device_model.read, device_group.read, location.read, live_data.read, file_model.read

Authorizations:
query Parameters
limit
integer [ 1 .. 1000 ]
Default: 10

Pagination limit - maximum number of entities to return

offset
integer [ 0 .. 10000 ]
Default: 0

Pagination offset. offset + limit can not be bigger than the max value configured per setup (default is 10000)

locationbox
boolean
Default: false

If true, the response contains a locationBox field. It's an object with four coordinates which describe boundaries of the area where the devices are located.

groupdata
boolean
Default: false

If true, the response contains a deviceGroups.metadata field which has the metadata of each group the device belongs to

Request Body schema: application/json

Search query.

Array of objects

Each element is a separate set of filters (with AND operation between them). All elements are translated into one query with OR operator between them, for example for two elements in the array (deviceName = "foo" AND city = "berlin") OR (deviceModelName = "radiator" AND city = "katowice")

Array of objects

Sorting definition

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Delete a device

Deletes the device specified in the path

permissions: device.write, device.read

Authorizations:
path Parameters
deviceId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Device ID

Responses

Response samples

Content type
application/json
{
}

Return a device

Returns the device specified in the path

permissions: device.read

Authorizations:
path Parameters
deviceId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Device ID

Responses

Response samples

Content type
{
}

Update a device

Updates the information of the device specified in the path

permissions: device.write, device.read, device_model.read

Authorizations:
path Parameters
deviceId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Device ID

Request Body schema: application/json
externalId
string <= 64 characters Nullable

A customer-provided identifier for the device. This allows the customer to assign a meaningful ID, such as a serial number, to the device. The External ID must be unique within the organization.

modelId
string^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

The model ID of the device

modelVersion
integer >= 1

Version of the specified model

name
string <= 64 characters ^(?!\s*$).+

Name of the device

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Delete an externalId from a device

Deletes the external ID value from a specified deviceId. If the device has no external Id on it, then this will result to no-op.

permissions: device.write, device.read

Authorizations:
path Parameters
deviceId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Device ID

Responses

Response samples

Content type
application/json
{
}

Remove a device from several device groups

Removes the device specified in the path from the device groups specified in the query

permissions: device_group.read, device_group.write, device.read

Authorizations:
path Parameters
deviceId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Device ID

Request Body schema: application/json
Array ()
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Id of device group

Responses

Request samples

Content type
application/json
[
]

Response samples

Content type
application/json
{
}

Return device groups for a device

Returns the device groups to which the device specified in the path belongs

permissions: device_group.read, device.read

Authorizations:
path Parameters
deviceId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Device ID

Responses

Response samples

Content type
application/json
{
}

Add a device to several device groups

Adds the device specified in the path to the device groups specified in the query

permissions: device_group.read, device_group.write, device.read

Authorizations:
path Parameters
deviceId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Device ID

Request Body schema: application/json
Array ()
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Id of device group

Responses

Request samples

Content type
application/json
[
]

Response samples

Content type
application/json
{
}

Update device groups for a device

Updates the device groups to which the device specified in the path belongs to the device groups specified in the query

permissions: device_group.read, device_group.write, device.read

Authorizations:
path Parameters
deviceId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Device ID

Request Body schema: application/json
Array ()
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Id of device group

Responses

Request samples

Content type
application/json
[
]

Check user permissions for a device

Check if user has permissions for the device specified in the path

permissions: device.read

Authorizations:
path Parameters
deviceId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Device ID

Responses

Response samples

Content type
application/json
{
}

Device Groups

Devices are sorted into device groups in the relayr Cloud to simplify sending data to multiple devices at once. A device group always has a parent group and can contain multiple devices and multiple device subgroups.

The endpoints presented in this section let you create and manage device groups.

[DEPRECATED] Return all device groups Deprecated

DEPRECATED - Can be replaced with GET /device-groups/info and then subsequent calls to GET /device-groups/{id}/subgroups to get groups on a lower level of a tree. This endpoint will be deleted on 2021-04-19

permissions: device_group.read, device.read
Authorizations:

Responses

Response samples

Content type
application/json
{
}

Create a device group

Creates a device group in your organization

permissions: device_group.read, device_group.write, device.read

Authorizations:
Request Body schema: application/json
name
required
string [ 1 .. 64 ] characters ^(?!\s*$).+

Name of the group

parentId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

ID of the parent group (nullable UUID) as a string

deviceIds
Array of strings <uuid>

IDs for the devices belonging to the group

externalId
string <= 64 characters Nullable

A customer-provided identifier for the device. This allows the customer to assign a meaningful ID, such as a serial number, to the device. The External ID must be unique within the organization.

modelId
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

ID of the device group model

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Return all the top level device groups for a user

Returns an array with information summary regarding each of a user's top level device groups. The response is paginated and sorted by the group creation date.

permissions: device_group.read
Authorizations:
query Parameters
userId
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Return only the top level groups for the provided userId (that are visible using the provided token)

limit
string^\d+$
Default: "100"
Example: limit=10

pagination limit - max number of entities to return

offset
string^\d+$
Default: "0"
Example: offset=20

pagination offset

Responses

Response samples

Content type
application/json
{
}

Search for device groups (OR)

Searches for device groups matching one OR several parameters specified in the query. If no parameter is specified, all the device groups you have access to are returned.

permissions: device.read, device_group.read, location.read, live_data.read

Authorizations:
query Parameters
limit
integer [ 1 .. 1000 ]
Default: 10

Pagination limit - maximum number of entities to return

offset
integer [ 0 .. 10000 ]
Default: 0

Pagination offset. offset + limit can not be bigger than the max value configured per setup (default is 10000)

locationbox
boolean
Default: false

If true, the response contains a locationBox field. It's an object with four coordinates which describe boundaries of the area where the devices are located.

Request Body schema: application/json

Search query.

Array of objects

Each element is a separate set of filters (with AND operation between them). All elements are translated into one query with OR operator between them, for example for two elements in the array it can be (groupName = "foo" AND city = "berlin") OR (groupName = "bar" AND city = "katowice")

Array of objects

Sorting definition

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Search for device groups (AND)

Searches for device groups matching ALL the parameters specified in the query. If no parameter is specified, all the device groups you have access to are returned. For example: if you specify groupName: foo and city: berlin, this endpoint returns you all devices groups that are called foo and are located in berlin.

permissions: device.read, device_group.read, location.read, live_data.read

Authorizations:
query Parameters
limit
integer [ 1 .. 1000 ]
Default: 10

Pagination limit - maximum number of entities to return

offset
integer [ 0 .. 10000 ]
Default: 0

Pagination offset. offset + limit can not be bigger than the max value configured per setup (default is 10000)

locationbox
boolean
Default: false

If true, the response contains a locationBox field. It's an object with four coordinates which describe boundaries of the area where the devices are located.

Request Body schema: application/json

Search query.

address
string

Case-insensitive, wildcards (*) accepted. Usually a street and a house number the device group is located at

city
string

Case-insensitive, wildcards (*) accepted. The city the device group is located in

country
string

Case-insensitive, wildcards (*) accepted. The country the device group is located in

externalId
string

Case-insensitive, wildcards (*) accepted. The external identifier of the device group

groupId
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...

Case-insensitive, NO wildcards. The ID of the device group

groupName
string

Case-insensitive, wildcards (*) accepted. Name of the device group

object

The coordinates which describe boundaries of the area where the devices are located.

mapBoxFeature
string

Case-sensitive, NO wildcards. MapBox based representation of the location

metadata
any

A JSON object consisting of metadata. The keys correspond to the metadata keys (e.g. ‘color’, ‘smoothness’). The corresponding value can be a string, number or boolean. Key is case-sensitive. String value is case-insensitive, accepts wildcards (*).

modelName
string

Case-insensitive, wildcards (*) accepted. Name of the device group model

parentId
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...

Case-insensitive, NO wildcards. The ID of the device group directly above in the group hierarchy

zipCode
string

Case-insensitive, wildcards (*) accepted. The postal/zip code of the location

Array of objects

Sorting definition

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Return all device groups as a tree

Return all device groups as a tree

permissions: device_group.read
Authorizations:

Responses

Response samples

Content type
application/json
{
}

Returns all the visible users

Returns a list of all the users from the groups and the groups to which they belong. You will only see users and groups you have access to. The response is paginated and sorted by the userId in asc order.

permissions: device_group.read, user.read

Authorizations:
query Parameters
limit
string^\d+$
Default: "100"
Example: limit=10

pagination limit - max number of entities to return

offset
string^\d+$
Default: "0"
Example: offset=20

pagination offset

Responses

Response samples

Content type
application/json
{
}

Delete a device group

Deletes the device group specified in the path. The group must be empty.

permissions: device_group.read, device_group.write

Authorizations:
path Parameters
groupId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Group ID

Responses

Response samples

Content type
application/json
{
}

[DEPRECATED] Return a device group in a nested structure Deprecated

DEPRECATED - Can be replaced with GET /device-groups/{id}/info some of the previous information will need to be fetched separately This endpoint will be deleted on 2021-04-19

permissions: device_group.read, device.read

Authorizations:
path Parameters
groupId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Group ID

Responses

Response samples

Content type
application/json
{
}

Update a device group

Updates the information of the device group specified in the path

permissions: device_group.read, device_group.write, device.read

Authorizations:
path Parameters
groupId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Group ID

Request Body schema: application/json
externalId
string <= 64 characters Nullable

A customer-provided identifier for the device. This allows the customer to assign a meaningful ID, such as a serial number, to the device. The External ID must be unique within the organization.

modelId
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

ID of the device group model

name
string [ 1 .. 64 ] characters ^(?!\s*$).+

Name of the group

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Return the ancestors of a device group

Returns the ancestors of the device group specified in the path

permissions: device_group.read

Authorizations:
path Parameters
groupId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Group ID

query Parameters
includeRequestedGroup
string
Enum: "true" "false"

If set to "true", response will include requested group in the ancestry response. For any other value or when no value is provided, only ancestors will be returned.

Responses

Response samples

Content type
application/json
{
}

Delete several devices from a device group

Deletes the devices specified in the query from the device group specified in the path. The list must contain only direct child devices of the group.

permissions: device_group.read, device_group.write, device.read

Authorizations:
path Parameters
groupId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Group ID

Request Body schema: application/json

IDs of the deviceIds to remove from the group

Array ()
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Id of device

Responses

Request samples

Content type
application/json
[
]

Response samples

Content type
application/json
{
}

Returns the group's direct devices

Returns a list of direct devices in the group. The response is paginated and sorted by device creation date.

permissions: device_group.read, device.read

Authorizations:
path Parameters
groupId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Group ID

query Parameters
limit
string^\d+$
Default: "100"
Example: limit=10

pagination limit - max number of entities to return

offset
string^\d+$
Default: "0"
Example: offset=20

pagination offset

Responses

Response samples

Content type
application/json
{}

Add several devices to a device group

Adds the devices specified in the query to the device group specified in the path

permissions: device_group.read, device_group.write, device.read

Authorizations:
path Parameters
groupId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Group ID

Request Body schema: application/json

IDs of the devices to add to the group

Array ()
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Id of device

Responses

Request samples

Content type
application/json
[
]

Response samples

Content type
application/json
{
}

Update devices for a group

Updates the devices belonging to the device group specified in the path to the devices specified in the query

permissions: device_group.read, device_group.write, device.read

Authorizations:
path Parameters
groupId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Group ID

Request Body schema: application/json
Array ()
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Id of device

Responses

Request samples

Content type
application/json
[
]

Response samples

Content type
application/json
{
}

[DEPRECATED] Return a device group in a flat array Deprecated

DEPRECATED - Can be replaced with GET /device-groups/{id}/info some of the previous information will need to be fetched separately This endpoint will be deleted on 2021-04-19

permissions: device_group.read, device.read

Authorizations:
path Parameters
groupId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Group ID

Responses

Response samples

Content type
application/json
{
}

Return a device group info

Returns the information regarding the requested device group

permissions: device_group.read
Authorizations:
path Parameters
groupId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Group ID

Responses

Response samples

Content type
application/json
{
}

Returns all the subgroups of a group

Returns a list of all the directly associated groups of a group. The response is paginated and sorted by the group creation date.

permissions: device_group.read

Authorizations:
path Parameters
groupId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Group ID

query Parameters
limit
string^\d+$
Default: "100"
Example: limit=10

pagination limit - max number of entities to return

offset
string^\d+$
Default: "0"
Example: offset=20

pagination offset

Responses

Response samples

Content type
application/json
{}

Returns a list of users associated with a device group

Returns the users belonging to the device group specified in the path. The response is paginated and sorted by userId.

permissions: device_group.read

Authorizations:
path Parameters
groupId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Group ID

query Parameters
indirect
string
Enum: "true" "false"

If true include all children groups in response

limit
string^\d+$
Default: "100"
Example: limit=10

pagination limit - max number of entities to return

offset
string^\d+$
Default: "0"
Example: offset=20

pagination offset

Responses

Response samples

Content type
application/json
{}

Device Group Models

Device group models are entities you can use in the relayr Cloud to label device groups for purposes specific to your use case. The endpoints presented in this section let you create and manage device group models.

Get the device group models

Get all the device group models in your organization. The response is paginated. You can set custom offset (default 0) and limit (default 100) parameters for the pagination.

permissions: device_group.read

Authorizations:
query Parameters
limit
string^\d+$
Default: "100"
Example: limit=10

pagination limit - max number of entities to return

offset
string^\d+$
Default: "0"
Example: offset=20

pagination offset

Responses

Response samples

Content type
application/json
{}

Create a device group model

Creates a device group model in your organization

permissions: device_group.read, device_group.write

Authorizations:
Request Body schema: application/json
name
required
string [ 1 .. 64 ] characters ^(?!\s*$).+

Name of the device group model

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Delete a device group model

Deletes the device group model specified in the path. The model must not be in use by any group.

permissions: device_group.read, device_group.write

Authorizations:
path Parameters
id
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: d9be177a-b276-11e7-aa7a-afcc578adb22

Device Group Model Id

Responses

Response samples

Content type
application/json
{
}

Return a device group model

Returns the information of the device group model specified in the path

permissions: device_group.read

Authorizations:
path Parameters
id
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: d9be177a-b276-11e7-aa7a-afcc578adb22

Device Group Model Id

Responses

Response samples

Content type
application/json
{
}

Update a device group model

Updates the information of the device group model specified in the path

permissions: device_group.read, device_group.write

Authorizations:
path Parameters
id
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: d9be177a-b276-11e7-aa7a-afcc578adb22

Device Group Model Id

Request Body schema: application/json
name
required
string [ 1 .. 64 ] characters ^(?!\s*$).+

Name of the device group model

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

File Models

Files models are entities you must create in the Cloud in order to use the software installation endpoints (go to Additional Services > Software Installation - Device in the left navigation panel for more information on installation tasks). They represent the software or software updates you want to install on your virtual or physical pieces of equipment.

A file model has a name and a description, while the actual information about the files you want installed on your virtual or physical pieces of equipment is defined in a version of a file model. File models can have several versions which can be enabled or disabled. Only enabled file model versions can be used for installations.

The endpoints presented in this section let you create and manage file models.

Return a file model

Returns all file models to which you have access

permissions: file_model.read

Authorizations:

Responses

Response samples

Content type
application/json
{
}

Create a file model

Creates a file model in your organization

permissions: file_model.read, file_model.write

Authorizations:
Request Body schema: application/json
name
required
string^.{1,64}$

Name of the File Model

description
string^.{1,256}$

Description of the File Model

type
string^.{1,64}$

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Delete a file model

Deletes the file model specified in the path

permissions: file_model.write

Authorizations:
path Parameters
fileModelID
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: 000078b3-261e-4025-9d81-b8631d8d0000

File Model ID (UUID)

Responses

Response samples

Content type
application/json
{
}

Return a file model

Returns the file model specified in the path

permissions: file_model.read

Authorizations:
path Parameters
fileModelID
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: 000078b3-261e-4025-9d81-b8631d8d0000

File Model ID (UUID)

Responses

Response samples

Content type
application/json
{
}

Update a file model

Updates the file model specified in the path

permissions: file_model.read, file_model.write

Authorizations:
path Parameters
fileModelID
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: 000078b3-261e-4025-9d81-b8631d8d0000

File Model ID (UUID)

Request Body schema: application/json
description
string^.{1,256}$

Description of the File Model

name
string^.{1,64}$

Name of the File Model

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Return all versions of a file model

Returns all versions of the file model specified in the path

permissions: file_model.read

Authorizations:
path Parameters
fileModelID
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: 000078b3-261e-4025-9d81-b8631d8d0000

File Model ID (UUID)

Responses

Response samples

Content type
application/json
{
}

Create a file model version

Creates a version for the file model specified in the path

permissions: file_model.read, file_model.write

Authorizations:
path Parameters
fileModelID
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: 000078b3-261e-4025-9d81-b8631d8d0000

File Model ID (UUID)

Request Body schema: application/json
location
required
string
buildStamp
string^.{1,64}$
default
boolean
Default: false

Can be true only if enabled is also true

description
string^.{1,256}$
enabled
boolean
Default: true
fileName
string^.{1,256}$

Destination file name

signature
string
signatureType
string^.{1,64}$
size
number

File size in bytes

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Return a file model version

Returns the model version specified in the path for the file model specified in the path

permissions: file_model.read

Authorizations:
path Parameters
fileModelID
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: 000078b3-261e-4025-9d81-b8631d8d0000

File Model ID (UUID)

fileModelVersionNumber
required
integer >= 1
Example: 5

File Model version number

Responses

Response samples

Content type
application/json
{
}

Update a file model version

Updates the model version specified in the path for the file model specified in the path

permissions: file_model.read, file_model.write

Authorizations:
path Parameters
fileModelID
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: 000078b3-261e-4025-9d81-b8631d8d0000

File Model ID (UUID)

fileModelVersionNumber
required
integer >= 1
Example: 5

File Model version number

Request Body schema: application/json
default
boolean
Default: false

Can be true only if enabled is also true

description
string^.{1,256}$

Description of the File Model Version

enabled
boolean

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Roles

Roles are entities allowing you to manage what users are allowed to do in the Cloud. You must create a role and assign it permissions before you can create a user.

The endpoints presented in this section let you create and manage roles and permissions.

Return all roles

Returns all roles to which you have access

permissions: role.read

Authorizations:

Responses

Response samples

Content type
application/json
{
}

Create a role

Creates a role in your organization

permissions: role.read, role.write

Authorizations:
Request Body schema: application/json

The information of the role to create. All fields except 'name' are optional.

name
required
string [ 1 .. 64 ] characters ^[^\f\n\r\t]{0,63}\S

Name of the role

description
string <= 256 characters ^[^\f\n\r\t]*

Description of the role

permissions
Array of strings non-empty

List of permissions that this role should encompass

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Delete a role

Deletes the role specified in the path. The role must have no user associated to it.

permissions: role.write

Authorizations:
path Parameters
roleId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: ecbbb77d-b91c-4a33-989d-2d072bb59b68

Role ID

Responses

Response samples

Content type
application/json
{
}

Return a role

Returns the role specified in the path

permissions: role.read

Authorizations:
path Parameters
roleId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: ecbbb77d-b91c-4a33-989d-2d072bb59b68

Role ID

Responses

Response samples

Content type
application/json
{
}

Update a role

Updates the role specified in the path. If permissions are specified then they will replace the set of permissions that are currently linked to the given role. You must have access to all users linked to this role.

permissions: role.read, role.write

Authorizations:
path Parameters
roleId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: ecbbb77d-b91c-4a33-989d-2d072bb59b68

Role ID

Request Body schema: application/json
description
string <= 256 characters ^[^\f\n\r\t]*

Description of the role

name
string [ 1 .. 64 ] characters ^[^\f\n\r\t]{0,63}\S

Name of the role

permissions
Array of strings non-empty

List of permissions that this role should encompass

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Return users for a role

Returns the users associated to the role specified in the path

permissions: user_role.read

Authorizations:
path Parameters
roleId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: ecbbb77d-b91c-4a33-989d-2d072bb59b68

Role ID

Responses

Response samples

Content type
application/json
{
}

Replace users in a role

Replaces the current users of the role specified in the path with the users specified in the query.

permissions: user_role.write

Authorizations:
path Parameters
roleId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: ecbbb77d-b91c-4a33-989d-2d072bb59b68

Role ID

Request Body schema: application/json

IDs of users that should have the given role

Array ()
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Responses

Request samples

Content type
application/json
[
]

Response samples

Content type
application/json
{
}

Users

Users are entities representing people in the relayr Cloud. You can create them to allow groups of people to access entities and services in your organization. Before creating a user, you must create a role and tie it to permissions.

The endpoints presented in this section let you create and manage users.

Create a user

Creates a user with the information provided in the request body in the Cloud. In this endpoint you must provide a password for the user. To create a user without specifying a password for them, use POST /users/invite.

permissions: user.read, user.write, user_role.read, user_role.write, device_group.read, device_group.write

Authorizations:
Request Body schema: application/json
userName
required
string <email> ^[a-zA-Z0-9!#$%&'*+/=?^_‘{|}~-]+(?:\.[a-zA-Z0...

Unique username in form of user email

password
required
string

Password has to be at least 8 characters long and contain at least one uppercase, one lowercase letter and a number

deviceGroupId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

User outside device group can not have access to any of the devices in the system, hence has to be added to an existing device group.

roleId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

User outside role can't have any permissions in the system, hence has to be added to an existing role.

familyName
string
givenName
string
phoneNumber
string

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Check if a user exists

Checks if the user specified in the organizations to which you have access.

permissions: user.read, user_role.read, device_group.read

Authorizations:
query Parameters
username
required
string^[a-zA-Z0-9.!'+_-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-...
active
string^(true|false)$
systemwide
string^(true|false)$

Responses

Response samples

Content type
application/json
{
}

Invite a user

Sends an email invitation to the Cloud to the user specified in the request body. This endpoint allows you to create users in the Cloud without providing a password for them. If you want to provide a password for the user, use POST /users.

permissions: user.read, user.write, user_role.read, user_role.write, device_group.read, device_group.write

Authorizations:
Request Body schema: application/json
clientId
required
string
redirectUri
required
string <uri>
required
Array of objects non-empty
lang
string

optional, must be ISO 639-1 (Alpha-2 code)

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
[
]

Search for users (AND)

Searches for users matching ALL the parameters specified in the query. If no parameter is specified, all the users you have access to are returned.

permissions: user.read, user_role.read, device_group.read

Authorizations:
query Parameters
limit
string [ 1 .. 50 ] ^\d+$
offset
string >= 0 ^\d+$
Request Body schema: application/json
active
boolean

boolean filter to check if user is active

deviceGroupName
string

case-insensitive, wildcards (*) accepted

excludeRoles
Array of strings

Exclude users which have any of these role names. Case-insensitive.

familyName
string

case-insensitive, wildcards (*) accepted

givenName
string

case-insensitive, wildcards (*) accepted

phoneNumber
string

case-insensitive, wildcards (*) accepted

roleName
string

case-insensitive, wildcards (*) accepted

Array of objects
userIds
Array of strings <uuid>
userName
string

case-insensitive, wildcards (*) accepted

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Delete a user

Deletes the user specified in the path from the roles and device groups to which they belong. The user is deleted permanently if they do not belong to any other organization.

permissions: user.read, user.write, user_role.read, user_role.write, device_group.read, device_group.write

Authorizations:
path Parameters
id
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: cea19e58-a633-4963-b29c-31a990587a5f

User ID

Responses

Response samples

Content type
application/json
{
}

Return a user

Returns the information of the user specified in the path

permissions: user.read

Authorizations:
path Parameters
id
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: cea19e58-a633-4963-b29c-31a990587a5f

User ID

Responses

Response samples

Content type
application/json
{
}

Update a user

Updates the information of the user specified in the path

Authorizations:
path Parameters
id
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: cea19e58-a633-4963-b29c-31a990587a5f

User ID

Request Body schema: application/json
familyName
string
givenName
string
phoneNumber
string

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Update a user name

Updates the user name of the user specified in the path

Authorizations:
path Parameters
id
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: cea19e58-a633-4963-b29c-31a990587a5f

User ID

Request Body schema: application/json
userName
string <email> ^[a-zA-Z0-9!#$%&'*+/=?^_‘{|}~-]+(?:\.[a-zA-Z0...

Unique username (user email)

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Delete a user from several device groups

Deletes the user specified in the path from the device groups specified in the query

permissions: device_group.read, device_group.write, user.read, user.write

Authorizations:
path Parameters
userId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

User ID

Request Body schema: application/json
Array ()
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Id of device group

Responses

Request samples

Content type
application/json
[
]

Response samples

Content type
application/json
{
}

Return device groups for a user

Returns the device groups to which the user specified in the path belongs

permissions: device_group.read, user.read

Authorizations:
path Parameters
userId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

User ID

query Parameters
indirect
string
Enum: "true" "false"

If true include all children groups in response

Responses

Response samples

Content type
application/json
{
}

Update device groups for a user

Updates the device groups to which the user specified in the path belongs to. A user can only be associated to a maximum of 15 device groups.

permissions: device_group.read, device_group.write, user.read, user.write

Authorizations:
path Parameters
userId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

User ID

Request Body schema: application/json
Array ()
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Id of device group

Responses

Request samples

Content type
application/json
[
]

Response samples

Content type
application/json
{
}

Return roles for a user

Returns the roles associated to the user specified in the path

permissions: user_role.read

Authorizations:
path Parameters
userId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: be291904-610e-407c-80aa-48da1b0e9904

Id of the user

Responses

Response samples

Content type
application/json
{
}

Update roles for a user

Updates the roles of the user specified in the path. You must have access to the user and to the roles you want to assign to the user.

permissions: user_role.write

Authorizations:
path Parameters
userId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: be291904-610e-407c-80aa-48da1b0e9904

Id of the user

Request Body schema: application/json

IDs of roles that the given user should have

Array ()
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Id of the role

Responses

Request samples

Content type
application/json
[
]

Response samples

Content type
application/json
{
}

Permissions

Permissions are entities you must link to roles in the Cloud. They define the actions a user can perform and the entities they can access. The endpoint presented in this section lets you retrieve the permissions available in the Cloud.

user.readView user data
user.writeManage user data
audit_log.readView audit logs
device.readView device information
device.writeManage device information
device_model.readView device model information
device_model.writeManage device model information
device_log.readView device logs
file_model.readView file model information
file_model.writeManage file model information
device_group.readView device group information
device_group.writeManage device group information
location.readView location information
location.writeManage location information
annotation.readView annotation information
annotation.writeManage annotation information
rule.readView rules
rule.writeManage rules
mqtt_credentials.readView MQTT credentials
mqtt_credentials.writeManage MQTT credentials
live_data.readView live data through different services
live_data.writeSend live data to the cloud
past_data.readView past data through different services
analytics.readView analytics results e.g. anomalies etc.
analytics.writeSend analytics data to the cloud
analytics_config.readView configurations for the analytics system
analytics_config.writeManage configurations for the analytics system
dashboard_config.readView dashboard configurations
dashboard_config.writeManage dashboard configurations
organization.readView organization metadata
organization.writeManage organization metadata
subscription.readView subscriptions
subscription.writeManage subscriptions
installation.readView installations
installation.writeManage installations
role.readView user roles
role.writeManage user roles
user_role.readView roles of users
user_role.writeManage roles of users
device_config.readView device configurations
device_config.writeManage device configurations

Return all permissions

Returns all permissions available in your organization

permissions: role.read

Authorizations:

Responses

Response samples

Content type
application/json
{
}

Aggregated Alerts

The endpoint presented in this section lets you aggregate the number of alerts sent by the devices of a same model over a period of time. The alerts can be filtered by severity.

Return alerts of all devices associated with a specific device model

Returns monthly buckets of aggregated alerts for the devices associated with the device model and the timeframe specified in the query

permissions: past_data.read

Authorizations:
query Parameters
deviceModelId
required
string <uuid>
Example: deviceModelId=d53b4877-2c93-4126-a0f8-e4644f1867fc

Only alerts from devices with this model will enter into the aggregation.

start
required
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...
Example: start=2018-06-01

Start date of the alert aggregation period

stop
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...
Example: stop=2018-11-01

End date of the alert aggregation period (default current date)

severities
integer [ 0 .. 7 ]
Example: severities=2

One or more alert severities separated by commas. If the filter is set, alerts with severities different than given will be filtered out.

Responses

Response samples

Content type
application/json
{
}

Alert Severities

In the relayr Cloud, alerts sent by devices can have a severity ranging from 0 to 7. The severity of an alert is chosen when creating the device model version of a device. For more information on device model versions, go to Entities > Device Models in the left navigation panel.

The endpoint presented in this section returns the current alert severities mapping of the Cloud.

Return alert severities mapping

Returns the current alert severities mapping, i.e. the severity level (High, Medium or Low) to which the alert severities (0-7) are mapped.

Authorizations:

Responses

Response samples

Content type
application/json
{
}

Alerts State

The endpoints presented in this section allow you to retrieve the last alerts sent by the devices to which you have access.

Return last sent alerts for multiple devices

Returns the last alerts sent by the devices specified in the query. If no device is specified, the endpoint returns the last alerts sent by all the devices to which you have access. The name and state parameter allow you to filter for a single specific alert.

permissions: live_data.read

Authorizations:
query Parameters
deviceIds
required
Array of strings
Example: deviceIds=7005afde-a298-11e7-be32-7bea3ce9040b,a25eabd4-a298-11e7-b907-a724a28f0dfd
name
string
Example: name=overheating
state
string
Enum: "set" "clear"
Example: state=clear

Responses

Response samples

Content type
application/json
{
}

Return last sent alerts for a device

Returns the last alerts sent by the device specified in the path. The name and state parameter allow you to filter for a single specific alert.

permissions: live_data.read

Authorizations:
path Parameters
deviceId
required
string <uuid>
Example: 1acc6cfd-2a4b-4f63-aac1-bab44ff1f6cc

Id of the device

query Parameters
name
string
Example: name=overheating
state
string
Enum: "set" "clear"
Example: state=clear

Responses

Response samples

Content type
application/json
{
}

Alerts Export

The relayr Cloud provides endpoints allowing you to export the alerts sent by the devices you have access to over a period of time.

The endpoints presented in this section allow you to export alerts in a csv format and to send the export by email to specific recipients.

Create an alert export

Exports the alerts sent by the devices specified in the query into a CSV file. The file is uploaded to the Azure Blob Storage and a notification email with the download URL is sent to the email address specified in the query. The download URL is valid for several days. The returned export ID can be used to retrieve the status of the export.

permissions: device.read, past_data.read

Authorizations:
Request Body schema: application/json

Sets the alert entity filter and an email address for the notification email.

email
required
string <email>

The address for the notification email that will be sent after the export finished.

alertNames
Array of strings

Limits export to alerts with one of these names.

deviceIds
Array of strings <uuid>

The alerts associated to devices with matching ids will be returned. Defaults to ids of the devices which are in the requesting user's device groups.

isSet
boolean

If set and true only those alert entities that are set but not cleared will be returned. If set and false only those entities that are set and cleared will be returned. If not set, all entities regardless of status are returned.

recordedFrom
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...

Limits export to alerts recorded from this timestamp on. Default is the current time. Needs to be a valid ISO-8601 datetime.

recordedTo
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...

Limits export to alerts recorded until this timestamp. If not set, all alerts newer than recordedFrom are selected. Needs to be a valid ISO-8601 datetime.

object

The severities of alerts.

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json

Delete an alert export

Deletes the information of the alert export specified in the path. The export is canceled if it is still pending.

permissions: device.read, past_data.read

Authorizations:
path Parameters
exportId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: 2b6d3a86-e1f8-4e91-833b-0a8357b01e17

The id of the alert export to retrieve.

Responses

Response samples

Content type
application/json
{
}

Return status for an alert export

Returns the status of the alert export specified in the path

permissions: device.read, past_data.read

Authorizations:
path Parameters
exportId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: 2b6d3a86-e1f8-4e91-833b-0a8357b01e17

The id of the alert export to retrieve.

Responses

Response samples

Content type
application/json

Alerts Import - HTTP

The relayr Cloud provides an endpoint allowing you to import alerts into devices. This endpoint can be used for testing purposes or to import alert-type events previously gathered on a piece of equipment.

NOTE: This endpoint does not create alerts, you must define the alerts to import in the model of the device before you can import them. Go to Entities > Device Models in the left navigation panel for more information on creating alerts.

Import alerts into a device

Imports the alerts specified in the request body into the device specified in the path. Alert with status set will be validated against current model version assigned to device. Exception are alerts with status clear they will not be validated. So it's possible to clear alerts that are not anymore part of device model.

permissions: live_data.write, live_data.read, device_model.read, device.read

Authorizations:
path Parameters
deviceId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: cea19e58-a633-4963-b29c-31a990587a5f

Id of the device to send data (measurement or alert) for.

Request Body schema: application/json
Array ()
name
required
string^[-.~a-zA-Z0-9_]+$

The name of the alert as defined in the device model.

state
required
string
Enum: "set" "clear"

The state of the alert. Can be either 'set' or 'clear'.

message
string^.{1,256}$

An optional human readable message that describes the alert.

timestamp
string <date-time>

ISO-8601 formatted timestamp

Responses

Request samples

Content type
application/json
[
]

Response samples

Content type
application/json
{
}

Alerts Acknowledgement

In the relayr Cloud, acknowledging an alert means letting other users know you have seen the alert and are taking care of it.

The endpoints presented in this section let you acknowledge alerts and check if alerts have been acknowledged.

Check acknowledgment status of an alert

Returns the acknowledgement status of the alert specified in the path

permissions: past_data.read

Authorizations:
path Parameters
alertId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

The id of the alert to retrieve.

Responses

Response samples

Content type
application/json
{
}

Mark an alert as acknowledged

Marks the alert specified in the path as acknowledged. Alerts can be acknowledged only once, meaning once an alert is acknowledged, consecutive calls to this endpoint for the same alert are ignored.

permissions: past_data.read, live_data.write

Authorizations:
path Parameters
alertId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

The id of the alert to retrieve.

Request Body schema: application/json
message
string <= 256 characters

Optional message to describe the alert acknowledgement event.

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Search for alerts

Searches for alerts according to the parameters specified in the query. If device groups are specified, all the devices they contain are searched, including the devices belonging to subgroups. If no device or device group is specified, all the devices you have access to are searched.

permissions: past_data.read

Authorizations:
query Parameters
limit
integer [ 1 .. 1000 ]

Pagination limit - maximum number of entities to return

offset
integer >= 0

Pagination offset

withusernames
boolean

If set and true, user given and family names (or email addresses if names are not set) will be attached in response.

Request Body schema: application/json
alerts
Array of strings
deviceGroupIds
Array of strings <uuid>
deviceIds
Array of strings <uuid>
isSet
boolean

If set and true only those alert entities that are set but not cleared will be returned. If set and false only those entities that are set and cleared will be returned. If not set, all entities regardless of status are returned.

setAfter
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...

The beginning of the time interval (inclusive) in which the alert was set. Needs to be a valid ISO-8601 datetime string.

setBefore
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...

The end of the time interval (exclusive) in which the alert was set. Needs to be a valid ISO-8601 datetime string.

object

The severities of alerts.

start
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...

The beginning of the time interval in which the alert is ongoing. An ongoing alert is set before or within the timespan and cleared after or within the timespan. Default is one hour ago. Needs to be a valid ISO-8601 datetime string. string.

stop
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...

The end of the time interval in which the alert is ongoing. An ongoing alert is set before or within the timespan and cleared after or within the timespan. Default is the current time. Needs to be a valid ISO-8601 datetime string.

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Return alerts for a device

Returns the alerts sent by the device specified in the path, according to the parameters specified in the query. Alerts are returned in reverse chronological order.

permissions: past_data.read

Authorizations:
path Parameters
deviceId
required
string <uuid>
Example: 1acc6cfd-2a4b-4f63-aac1-bab44ff1f6cc

The id of the device for which to retrieve the alert history. Needs to be a valid UUID and the user needs to have the necessary permissions for this device.

query Parameters
start
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...

The beginning of the time interval in which the alert is ongoing. An ongoing alert is set before or within the timespan and cleared after or within the timespan. Default is one hour ago. Needs to be a valid ISO-8601 datetime string. string.

stop
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...

The end of the time interval in which the alert is ongoing. An ongoing alert is set before or within the timespan and cleared after or within the timespan. Default is the current time. Needs to be a valid ISO-8601 datetime string.

alerts
string^[-.~a-zA-Z0-9_]{1,64}$
Example: alerts=too_hot

One or more alert names separated by commas. If the filter is set, only alerts with given names will be returned.

severities
integer [ 0 .. 7 ]
Example: severities=2

One or more alert severities separated by commas. If the filter is set, alerts with severities different than given will be filtered out.

severitymax
integer [ 0 .. 7 ]
Example: severitymax=2

Maximum value of alert severity. If set, alerts with severities greater than given will be filtered out.

severitymin
integer [ 0 .. 7 ]
Example: severitymin=2

Minimum value of alert severity. If set, alerts with severities lower than given will be filtered out.

limit
integer [ 1 .. 1000 ]

Pagination limit - maximum number of entities to return

offset
integer >= 0

Pagination offset

isset
boolean

If set and true only those alert entities that are set but not cleared will be returned. If set and false only those entities that are set and cleared will be returned. If not set, all entities regardless of status are returned.

withusernames
boolean

If set and true, user given and family names (or email addresses if names are not set) will be attached in response.

setafter
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...

The beginning of the time interval (inclusive) in which the alert was set. Needs to be a valid ISO-8601 datetime string.

setbefore
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...

The end of the time interval (exclusive) in which the alert was set. Needs to be a valid ISO-8601 datetime string.

Responses

Response samples

Content type
application/json
{
}

Aggregated Measurements

The endpoint presented in this section lets you aggregate the measurement values sent by a device over a period of time.

Return measurement aggregations for a device

Returns the measurement values specified in the query for the device specified in the path. This endpoint also lets you choose different intervals of aggregation. There is a limit of 1440 data points that can be returned by this endpoint.

permissions: past_data.read, device.read

Authorizations:
path Parameters
deviceId
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: cea19e58-a633-4963-b29c-31a990587a5f

Device ID

query Parameters
measurement
required
string^(?!\s*$).+
Example: measurement=temperature

Measurement to query for

start
required
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...
Example: start=2017-06-13T15:19:59.673+02:00

Start date and time of the query (inclusive)

interval
required
string
Default: "1m"
Enum: "10s" "1m" "5m" "30m" "1h" "6h" "12h" "1d" "2d" "5d" "1w"
Example: interval=1m

The aggregation interval

end
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...
Example: end=2017-06-13T15:19:59.673+02:00

End date and time of the query (exclusive). If not provided, defaults to current time.

lastReceived
string^(true|false)$

boolean whether to add timestamp of latest measurment to each bucket

Responses

Response samples

Content type
application/json
{
}

Measurements State

The endpoints presented in this section allow you to retrieve the last measurements sent by the devices to which you have access.

Return last sent measurements for multiple devices

Returns the last measurements sent by the devices specified in the query. If no device is specified, the endpoint returns the last measurements sent by all the devices to which you have access. The name parameter allows you to filter for a single specific measurement.

permissions: live_data.read

Authorizations:
query Parameters
deviceIds
required
Array of strings
Example: deviceIds=7005afde-a298-11e7-be32-7bea3ce9040b,a25eabd4-a298-11e7-b907-a724a28f0dfd
name
string
Example: name=temperature

Responses

Response samples

Content type
application/json
{
}

Return last sent measurements for a device

Returns the last measurements sent by the device specified in the path. The name parameter allows you to filter for a single specific measurement.

permissions: live_data.read

Authorizations:
path Parameters
deviceId
required
string <uuid>
Example: 1acc6cfd-2a4b-4f63-aac1-bab44ff1f6cc

Id of the device

query Parameters
name
string
Example: name=temperature

Responses

Response samples

Content type
application/json
{
}

Measurements Export

The relayr Cloud provides endpoints allowing you to export the measurements sent by the devices you have access to over a period of time.

The endpoints presented in this section allow you to export measurements in a variety of formats including csv.

Export measurements for multiple devices

Exports the measurements specified in the request body sent by the devices specified in the request body. Request duration between start - end should respect following limits to avoid 400 BadRequest.

json - 1 day, csv - 1 day, json_chunks - 1 week

permissions: past_data.read, device.read

Authorizations:
Request Body schema: application/json
deviceIds
required
Array of strings non-empty

List of devices for which raw measurements will be returned.

start
required
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...

The beginning of the time interval from which the raw measurements will be returned. Default is one hour ago.

end
required
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...

The end of the time interval from which the raw measurements will be returned. Default is the current time.

measurements
required
Array of strings non-empty

Array of measurements

type
string
Enum: "json" "json_chunks" "csv"

Type of returned data

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
[
]

Export measurements for a device

Exports the measurements specified in the query sent by the device specified in the path. Request duration between start - end should respect following limits to avoid 400 BadRequest.

json - 1 day, csv - 1 day, json_chunks - 1 week

permissions: past_data.read, device.read

Authorizations:
path Parameters
deviceId
required
string^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: cea19e58-a633-4963-b29c-31a990587a5f

Id of the device whose raw measurements will be returned.

query Parameters
measurements
required
Array of strings
Example: measurements=temperature

One or more measurement names separated by commas

start
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...
Example: start=2017-06-13T15:19:59.673+02:00

The beginning of the time interval (inclusive) from which the raw measurements will be returned. Default is one hour ago.

end
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...
Example: end=2017-06-13T15:19:59.673+02:00

The end of the time interval (exclusive) from which the raw measurements will be returned. Default is the current time.

type
string
Default: "json"
Enum: "json" "json_chunks" "csv"
Example: type=json

If provided defines content type returned by the service. Default result type is 'json'

Responses

Response samples

Content type
[
]

Measurements Import - HTTP

The relayr Cloud provides an endpoint allowing you to import measurements into devices. This endpoint can be used for testing purposes or to import measurement-type events previously gathered on a piece of equipment.

NOTE: This endpoint does not create measurements, you must define the measurements to import in the model of the device before you can import them. Go to Entities > Device Models in the left navigation panel for more information on creating measurements.

Import measurements into multiple devices

Imports the measurements specified in the request body into the corresponding attributed devices

permissions: live_data.write, live_data.read, device_model.read, device.read

Authorizations:
Request Body schema: application/json

The measurements to send.

Array ()
deviceId
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Unique ID for each device sending measurements

Array of objects non-empty

Responses

Request samples

Content type
application/json
[
]

Response samples

Content type
application/json
{
}

Import measurements into a device

Imports the measurements specified in the request body into the device specified in the path

permissions: live_data.write, live_data.read, device_model.read, device.read

Authorizations:
path Parameters
deviceId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: cea19e58-a633-4963-b29c-31a990587a5f

Id of the device to send data (measurement or alert) for.

Request Body schema: application/json

The measurements to send.

Array ()
name
required
string^[-.~a-zA-Z0-9_]+$

The name of the measurement as defined in the device model.

required
integer or number or string or boolean

The value of a measurement can be of different types (integer, number, string, boolean)

timestamp
string <date-time>

ISO-8601 formatted timestamp

Responses

Request samples

Content type
application/json
[
]

Response samples

Content type
application/json
{
}

Commands Execution - HTTP

In the relayr Cloud, commands are used to send instructions to a device, for example turning on a light or setting a target temperature for a thermostat. The endpoints presented in this section allow you to create and manage command tasks on a device.

NOTE: These endpoints do not create commands, you must define the commands to execute in the model of the device before you can create a command task. Go to Entities > Device Models in the left navigation panel for more information on creating commands.

Return all command tasks for a device

Returns all the command tasks existing for the device specified in the path

permissions: live_data.read, device.read

Authorizations:
path Parameters
deviceId
required
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...
Example: be3faaa1-6165-4439-93b8-ecfb8febc0b7

Device ID of the task

query Parameters
commandStatus
string
Enum: "unknown" "in_progress" "success" "error"
Example: commandStatus=in_progress

Latest command status to filter for

deliveryStatus
string
Enum: "pending" "delivered" "timeout" "aborted"
Example: deliveryStatus=delivered

Latest delivery status to filter for

Responses

Response samples

Content type
application/json
{
}

Return command tasks

Returns the command tasks matching the parameters specified in the query

permissions: live_data.read

Authorizations:
query Parameters
commandStatus
string
Enum: "unknown" "in_progress" "success" "error"
Example: commandStatus=in_progress

Latest command status to filter for

deliveryStatus
string
Enum: "pending" "delivered" "timeout" "aborted"
Example: deliveryStatus=delivered

Latest delivery status to filter for

entityIds
Array of strings <uuid>

IDs of the entities of the tasks

taskIds
Array of strings <uuid>

Tasks IDs

Responses

Response samples

Content type
application/json
{
}

Create a command task

Creates a command task for the device specified in the request body

permissions: live_data.write, device.read, device_model.read

Authorizations:
Request Body schema: application/json
deviceId
required
string <UUID> ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...
name
required
string <= 64 characters ^(?!\s*$).+

Descriptive name for the task

required
object
description
string <= 256 characters

Additional task description

end
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...

End task at this point in the future - default 1 hour

start
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...

Start task at this point in the future - default now

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Delete a command task

Deletes the command task specified in the path

permissions: live_data.write, device.read

Authorizations:
path Parameters
taskId
required
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...
Example: be3faaa1-6165-4439-93b8-ecfb8febc0b7

Task ID

Responses

Response samples

Content type
application/json
{
}

Return a command task

Returns the command task specified in the path

permissions: live_data.read, device.read

Authorizations:
path Parameters
taskId
required
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...
Example: be3faaa1-6165-4439-93b8-ecfb8febc0b7

Task ID

Responses

Response samples

Content type
application/json
{
}

Update a command task

Updates the command task specified in the path

permissions: live_data.write, device.read

Authorizations:
path Parameters
taskId
required
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...
Example: be3faaa1-6165-4439-93b8-ecfb8febc0b7

Task ID

Request Body schema: application/json
description
string <= 256 characters

Additional task description

end
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...

End task at this point in the future - default 1 hour

name
string <= 64 characters ^(?!\s*$).+

Descriptive name for the task

start
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...

Start task at this point in the future - default now

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Cancel a command task

Cancels the command task specified in the path

permissions: live_data.write, device.read

Authorizations:
path Parameters
taskId
required
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...
Example: be3faaa1-6165-4439-93b8-ecfb8febc0b7

Task ID

Responses

Response samples

Content type
application/json
{
}

Commands Import - HTTP

The relayr Cloud provides an endpoint allowing you to import commands into devices. This endpoint can be used for testing purposes or to import command-type events previously gathered on a piece of equipment.

NOTE: This endpoint does not create commands, you must first define the commands to import in the model of the device before you can import them. Go to Entities > Device Models in the left navigation panel for more information on creating commands.

Import commands into a device

Imports the commands specified in the request body into the device specified in the path

permissions: live_data.write, live_data.read, device_model.read, device.read

Authorizations:
path Parameters
deviceId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: cea19e58-a633-4963-b29c-31a990587a5f

Id of the device to send data (measurement or alert) for.

Request Body schema: application/json

The list of commands to send. If ID is not provided it will be added by the service and returned in response.

Array ()
name
required
string^[-.~a-zA-Z0-9_]+$

The name of the command to execute

id
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...

Unique command ID - has to be provided so command can be tracked

integer or number or string or boolean or object or Array of any

The value of a command can be of different types (integer, number, string, boolean, object, array)

timestamp
string <date-time>

ISO-8601 formatted timestamp

Responses

Request samples

Content type
application/json
[
]

Response samples

Content type
application/json
{
}

Metadata - Entity

Metadata are arbitrary key/value pairs you can add to a device, a device group, a user or an organization to give more information about what they represent.

In the relayr Cloud, the key represents the type of information you want to add to the entity while the value represents the actual information. In the JSON schema of the entity, the keys have to be strings while the values can be of any JSON data type.

The endpoints presented in this section let you create and manage device, device group and organization metadata ONLY. To create metadata for users, go to Metadata - User in the left navigation panel.

Return key/value pairs for multiple entities

Returns the key/value pairs specified in the query for the entities specified in the query. If keysFilter is not specified, all key/value pairs for all specified entities are returned. In this endpoint entities can be devices or device groups. Please use GET /users/{userId}/metadata to return key/value pairs for a user.

permissions: entityName.read

Authorizations:
path Parameters
entityName
required
string
Enum: "devices" "device-groups"
Example: devices

An entity that can be associated with metadata. Currently, this can either be 'devices', 'device-groups'.

query Parameters
entityIds
required
Array of strings <uuid>
Example: entityIds=3f70b734-6f22-47e5-90a1-f2466ca75bc3&entityIds=8dced8b4-caec-44f1-86c4-2e0f1a889066

Comma separated list of entity ids. The metadata associated to entities with matching ids will be returned.

keysFilter
Array of strings
Example: keysFilter=color&keysFilter=parent&keysFilter=smoothness

Comma separated list of metadata keys - only those key/value pairs will be included in the returned metadata. If omitted the complete metadata is returned.

Responses

Response samples

Content type
application/json
{
}

Delete all key/value pairs

Deletes all the key/value pairs of the entity specified in the path. In this endpoint an entity can be a device, a device group or an organization. Please use DELETE /users/{userId}/metadata to delete all key/value pairs for a user.

permissions: {entityName}.write

Authorizations:
path Parameters
entityName
required
string
Enum: "devices" "device-groups" "organizations"
Example: devices

An entity that can be associated with metadata. Currently, this can either be 'devices', 'device-groups' or 'organizations'.

entityId
required
string <uuid>
Example: cea19e58-a633-4963-b29c-31a990587a5f

The id of the entity that is associated with the metadata. Needs to be a valid UUID and you must have the necessary permissions for this entity.

Responses

Response samples

Content type
application/json
{
}

Return key/value pairs for an entity

Returns the key/value pairs specified in the query for the entity specified in the path. If keysFilter is not specified, all key/value pairs for the entity are returned. In this endpoint an entity can be a device, a device group or an organization. Please use GET /users/{userId}/metadata to return key/value pairs for a user.

permissions: {entityName}.read

Authorizations:
path Parameters
entityName
required
string
Enum: "devices" "device-groups" "organizations"
Example: devices

An entity that can be associated with metadata. Currently, this can either be 'devices', 'device-groups' or 'organizations'.

entityId
required
string <uuid>
Example: cea19e58-a633-4963-b29c-31a990587a5f

The id of the entity that is associated with the metadata. Needs to be a valid UUID and you must have the necessary permissions for this entity.

query Parameters
keys
string

If the 'keys' parameter is set, it will only return the name of the keys for the specified entity id. The value of the query parameter will be ignored.

Responses

Response samples

Content type
application/json
Example
{
}

Create or update key/value pairs

Creates or updates the key/value pairs specified in the request body for the entity specified in the path. In this endpoint an entity can be a device, a device group or an organization. Please use PUT /users/{userId}/metadata to create or update key/value pairs for a user.

permissions: {entityName}.read, {entityName}.write

Authorizations:
path Parameters
entityName
required
string
Enum: "devices" "device-groups" "organizations"
Example: devices

An entity that can be associated with metadata. Currently, this can either be 'devices', 'device-groups' or 'organizations'.

entityId
required
string <uuid>
Example: cea19e58-a633-4963-b29c-31a990587a5f

The id of the entity that is associated with the metadata. Needs to be a valid UUID and you must have the necessary permissions for this entity.

Request Body schema: application/json

An array defining the keys and their associated values. If the value for any of the specified keys in the array already exists, it is updated with the new value specified in the array. If the value does not exist, it is created with the key-value pair specified in the array.

Array ()
key
required
string^[-.~_ äüöÄÜÖßa-zA-Z0-9]{1,64}$

No leading or trailing spaces allowed.

value
required
object

The value associated with the key.

Responses

Request samples

Content type
application/json
[
]

Response samples

Content type
application/json
{
}

Delete a key/value pair

Deletes the key/value pair specified in the path for the entity specified in the path. In this endpoint an entity can be a device, a device group or an organization. Please use DELETE /users/{userId}/metadata/{key} to delete a key/value pair for a user.

permissions: entityName.write

Authorizations:
path Parameters
entityName
required
string
Enum: "devices" "device-groups" "organizations"
Example: devices

An entity that can be associated with metadata. Currently, this can either be 'devices', 'device-groups' or 'organizations'.

entityId
required
string <uuid>
Example: cea19e58-a633-4963-b29c-31a990587a5f

The id of the entity that is associated with the metadata. Needs to be a valid UUID and you must have the necessary permissions for this entity.

key
required
string^[-.~_ äüöÄÜÖßa-zA-Z0-9]{1,64}$
Example: color

The key that is associated with the metadata. Must be urlencoded when containing special characters (use "%20" for spaces, not "+"). No leading or trailing spaces allowed.

Responses

Response samples

Content type
application/json
{
}

Return a key/value pair

Returns the key/value pair specified in the path for the entity specified in the path. In this endpoint an entity can be a device, a device group or an organization. Please use GET /users/{userId}/metadata/{key} to return a key/value pair for a user.

permissions: {entityName}.read

Authorizations:
path Parameters
entityName
required
string
Enum: "devices" "device-groups" "organizations"
Example: devices

An entity that can be associated with metadata. Currently, this can either be 'devices', 'device-groups' or 'organizations'.

entityId
required
string <uuid>
Example: cea19e58-a633-4963-b29c-31a990587a5f

The id of the entity that is associated with the metadata. Needs to be a valid UUID and you must have the necessary permissions for this entity.

key
required
string^[-.~_ äüöÄÜÖßa-zA-Z0-9]{1,64}$
Example: color

The key that is associated with the metadata. Must be urlencoded when containing special characters (use "%20" for spaces, not "+"). No leading or trailing spaces allowed.

Responses

Response samples

Content type
application/json
{
}

Create or update a key/value pair

Creates or updates the key/value pair specified in the path for the entity specified in the path. In this endpoint an entity can be a device, a device group or an organization. Please use PUT /users/{userId}/metadata/{key} to create or update a key/value pair for a user.

permissions: {entityName}.write

Authorizations:
path Parameters
entityName
required
string
Enum: "devices" "device-groups" "organizations"
Example: devices

An entity that can be associated with metadata. Currently, this can either be 'devices', 'device-groups' or 'organizations'.

entityId
required
string <uuid>
Example: cea19e58-a633-4963-b29c-31a990587a5f

The id of the entity that is associated with the metadata. Needs to be a valid UUID and you must have the necessary permissions for this entity.

key
required
string^[-.~_ äüöÄÜÖßa-zA-Z0-9]{1,64}$
Example: color

The key that is associated with the metadata. Must be urlencoded when containing special characters (use "%20" for spaces, not "+"). No leading or trailing spaces allowed.

Request Body schema: application/json

The metadata corresponding to the specified key. If the key does not exist, this call will create a new metadata entry for the specified entity and key. If the key already exists for the specified entity, the metadata corresponding to the key will be updated. The value may be any valid JSON and is not restricted to JSON objects.

object

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Metadata - User

Metadata are arbitrary key/value pairs you can add to a device, a device group, a user or an organization to give more information about what they represent.

In the relayr Cloud, the key represents the type of information you want to add to the entity while the value represents the actual information. For example if you wanted to say that a user lives in Berlin, you would add the key/value pair "key": "city", "value": "berlin" to the user. In the schema of the entity, the keys have to be strings while the values can be of any JSON data type.

The endpoints presented in this section let you create and manage user metadata.

Delete all key/value pairs

Deletes all the key/value pairs of the user specified in the path. Please note that you can only use your own userId in this endpoint and therefore only delete your own metadata.

Authorizations:
path Parameters
userId
required
string <uuid>
Example: cea19e58-a633-4963-b29c-31a990587a5f

The id of the user that is associated with the metadata. Needs to be a valid UUID.

Responses

Response samples

Content type
application/json
{
}

Return key/value pairs

Returns the key/value pairs specified in the query for the user specified in the path. If keysFilter is not specified, all key/value pairs are returned. Please note that you can only use your own userId in this endpoint and therefore only retrieve your own metadata.

Authorizations:
path Parameters
userId
required
string <uuid>
Example: cea19e58-a633-4963-b29c-31a990587a5f

The id of the user that is associated with the metadata. Needs to be a valid UUID.

query Parameters
keys
string

If the 'keys' parameter is set, it will only return the name of the keys for the specified entity id. The value of the query parameter will be ignored.

Responses

Response samples

Content type
application/json
Example
{
}

Create or update key/value pairs

Creates or updates the key/value pairs specified in the request body for the user specified in the path. Please note that you can only use your own userId in this endpoint and therefore only update your own metadata.

Authorizations:
path Parameters
userId
required
string <uuid>
Example: cea19e58-a633-4963-b29c-31a990587a5f

The id of the user that is associated with the metadata. Needs to be a valid UUID.

Request Body schema: application/json

An array defining the keys and their associated values. If the value for any of the specified keys in the array already exists, it is updated with the new value specified in the array. If the value does not exist, it is created with the key-value pair specified in the array.

Array ()
key
required
string^[-.~_ äüöÄÜÖßa-zA-Z0-9]{1,64}$

No leading or trailing spaces allowed.

value
required
object

The value associated with the key.

Responses

Request samples

Content type
application/json
[
]

Response samples

Content type
application/json
{
}

Delete a key/value pair

Deletes the key/value pair specified in the path for the user specified in the path. Please note that you can only use your own userId in this endpoint and therefore only delete your own metadata.

Authorizations:
path Parameters
userId
required
string <uuid>
Example: cea19e58-a633-4963-b29c-31a990587a5f

The id of the user that is associated with the metadata. Needs to be a valid UUID.

key
required
string^[-.~_ äüöÄÜÖßa-zA-Z0-9]{1,64}$
Example: color

The key that is associated with the metadata. Must be urlencoded when containing special characters (use "%20" for spaces, not "+"). No leading or trailing spaces allowed.

Responses

Response samples

Content type
application/json
{
}

Return a key/value pair

Returns the key/value pair specified in the path for the user specified in the path. Please note that you can only use your own userId in this endpoint and therefore only retrieve your own metadata.

Authorizations:
path Parameters
userId
required
string <uuid>
Example: cea19e58-a633-4963-b29c-31a990587a5f

The id of the user that is associated with the metadata. Needs to be a valid UUID.

key
required
string^[-.~_ äüöÄÜÖßa-zA-Z0-9]{1,64}$
Example: color

The key that is associated with the metadata. Must be urlencoded when containing special characters (use "%20" for spaces, not "+"). No leading or trailing spaces allowed.

Responses

Response samples

Content type
application/json
{
}

Create or update a key/value pair

Creates or updates the key/value pair specified in the path and request body for the user specified in the path. Please note that you can only use your own userId in this endpoint and therefore only update your own metadata.

Authorizations:
path Parameters
userId
required
string <uuid>
Example: cea19e58-a633-4963-b29c-31a990587a5f

The id of the user that is associated with the metadata. Needs to be a valid UUID.

key
required
string^[-.~_ äüöÄÜÖßa-zA-Z0-9]{1,64}$
Example: color

The key that is associated with the metadata. Must be urlencoded when containing special characters (use "%20" for spaces, not "+"). No leading or trailing spaces allowed.

Request Body schema: application/json

The metadata corresponding to the specified key. If the key does not exist, this call will create a new metadata entry for the specified user and key. If the key already exists for the specified user, the metadata corresponding to the key will be updated. The value may be any valid JSON and is not restricted to JSON objects.

object

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Metadata - Device

Metadata are arbitrary key/value pairs you can add to a device, a device group, a user or an organization to give more information about what they represent.

In the relayr Cloud, the key represents the type of information you want to add to the entity while the value represents the actual information. For example if you wanted to add the serial number 1234 to a device, you would add the key/value pair "key": "serial number", "value": 1234 to the device. In the schema of the entity, the keys have to be strings while the values can be of any JSON data type.

The endpoint presented in this section let you retrieve all the device metadata available to you. To create metadata for devices, go to Metadata - Entity in the left navigation panel.

Return all key/value pairs

Returns all key/value pairs for the devices to which you have access

permissions: device.read

Authorizations:

Responses

Response samples

Content type
application/json
{
}

Metadata - Device Group

Metadata are arbitrary key/value pairs you can add to a device, a device group, a user or an organization to give more information about what they represent.

In the relayr Cloud, the key represents the type of information you want to add to the entity while the value represents the actual information. For example if you wanted to say that all of the devices in a device group are red, you would add the key/value pair "key": "color", "value": "red" to the device group. In the schema of the entity, the keys have to be strings while the values can be of any JSON data type.

The endpoint presented in this section let you retrieve device group metadata. To create metadata for device groups, go to Metadata - Entity in the left navigation panel.

Return key/value pairs for a device group

Returns the key/value pairs specified in the query for the devices belonging to the device group specified in the path. If keysFilter is not specified, all key/value pairs for the specified device group are returned.

permissions: device.read, device_group.read

Authorizations:
path Parameters
deviceGroupId
required
string <uuid>
Example: cea19e58-a633-4963-b29c-31a990587a5f

The id of the device group that contains the entities associated with the metadata. Needs to be a valid UUID and you must have the permission to access the group.

query Parameters
keysFilter
Array of strings
Example: keysFilter=color&keysFilter=parent&keysFilter=smoothness

Comma separated list of metadata keys - only those key/value pairs will be included in the returned metadata. If omitted the complete metadata is returned.

Responses

Response samples

Content type
application/json
{
}

Alert Subscriptions - Device

In the relayr Cloud, alert subscriptions at device level allow you to get notifications by email or SMS whenever alerts are set or cleared on a specific device. Subscriptions can only be done at alert severity level, it is not possible to receive notifications for specific alerts.

The endpoints presented in this section let you create and manage alert subscriptions at device level.

Retrieve sent emails or SMS

Retrieves the emails/SMS messages that were sent for the timeframe, devices and alert severities specified in the query.

permissions: subscription.read, live_data.read

Authorizations:
query Parameters
limit
integer [ 1 .. 10000 ]

Pagination limit - maximum number of entities to return. Default is 10.

offset
integer >= 0

Pagination offset. Default is 0.

Request Body schema: application/json
deviceId
required
string <uuid>

ID of the device the for which notifications were sent

alertName
required
string

Name of the alert for which notifications were sent

start
required
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...

The beginning of the time interval in which notifications were sent

stop
required
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...

The end of the time interval in which notifications were sent

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Alert Subscriptions - Device Group

In the relayr Cloud, alert subscriptions at device group level allow you to get notifications by email or SMS whenever alerts are set or cleared on the devices of a specific device group. Subscriptions can only be done at alert severity level, it is not possible to receive notifications for specific alerts.

The endpoints presented in this section let you create and manage alert subscriptions at device group level.

Return all email and SMS subscriptions

Returns all subscriptions for the device groups specified in the query. You must have access to the device groups to see the subscriptions.

permissions: subscription.read

Authorizations:

Responses

Response samples

Content type
application/json
{
}

Create an email subscription

Creates an email subscription for the alert severities of the device groups specified in the query. An email is sent for every DeviceGroupAlertSet or DeviceGroupAlertClear event happening in the specified groups. Emails are also sent for devices included in subgroups of the specified groups.

permissions: subscription.write, live_data.read, device.read, location.read

Authorizations:
Request Body schema: application/json
name
required
string^.{1,256}$

short description for this subscription, will be displayed in UIs

deviceGroupIds
required
Array of strings <uuid> non-empty

ID of the device groups associated with the subscription.

alertCategories
required
Array of strings non-empty
Items Enum: "High" "Medium" "Low"

Incoming alerts are filtered by their severity category before notifications are send. Allowed values can be retrieved from '/alert-severity/mapping'.

emailAddresses
required
Array of strings <email> non-empty
notifyOnClear
boolean
Default: true

If this flag is false, notifications are only sent when alerts are set.

emailSubject
string^.{1,150}$

Email subject, you can use the same placeholders as in the email body template.

emailTemplate
string^.{1,2048}$

Template for Email notifications message. It can include the following placeholders: alert-name, alert-display-name, alert-severity, alert-severity-level, alert-message, alert-state, alert-recorded-ts (or alert-recorded-ts:< dateformat > where < dateformat > can be any valid Java DateTime format or alert-recorded-ts:< dateformat >@< zoneformat > where < dateformat > can be any valid Java DateTime format, < zoneformat > can be any valid ZoneId), alert-received-ts (or alert-received-ts:< dateformat > where < dateformat > can be any valid Java DateTime format or alert-received-ts:< dateformat >@< zoneformat > where < dateformat > can be any valid Java DateTime format, < zoneformat > can be any valid ZoneId), device-name, device-id, location-latitude, location-longitude, location-address, location-city, location-zip-code, metadata-< * > (where < * > can be any metadata key). For the elevator product there is also elevator-uri, which is a link to the elevator in the elevator dashboard. Placeholders should be included in double curly braces (e.g. {{alert-name}}). Detailed Java DateTime format documentation. Detailed Java ZoneId format documentation

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Delete an email subscription

Deletes the email subscription specified in the path

permissions: subscription.write

Authorizations:
path Parameters
subscriptionID
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: 000078b3-261e-4025-9d81-b8631d8d0000

ID (UUID) of the subscription

Responses

Response samples

Content type
application/json
{
}

Update an email subscription

Updates the email subscription specified in the path. See POST /alert-subscriptions/email-subscriptions endpoint for further details on subscriptions.

permissions: subscription.write, live_data.read, device.read, location.read

Authorizations:
path Parameters
subscriptionID
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: 000078b3-261e-4025-9d81-b8631d8d0000

ID (UUID) of the subscription

Request Body schema: application/json
name
required
string^.{1,256}$

short description for this subscription, will be displayed in UIs

deviceGroupIds
required
Array of strings <uuid> non-empty

ID of the device groups associated with the subscription.

alertCategories
required
Array of strings non-empty
Items Enum: "High" "Medium" "Low"

Incoming alerts are filtered by their severity category before notifications are send. Allowed values can be retrieved from '/alert-severity/mapping'.

emailAddresses
required
Array of strings <email> non-empty
notifyOnClear
boolean
Default: true

If this flag is false, notifications are only sent when alerts are set.

emailSubject
string^.{1,150}$

Email subject, you can use the same placeholders as in the email body template.

emailTemplate
string^.{1,2048}$

Template for Email notifications message. It can include the following placeholders: alert-name, alert-display-name, alert-severity, alert-severity-level, alert-message, alert-state, alert-recorded-ts (or alert-recorded-ts:< dateformat > where < dateformat > can be any valid Java DateTime format or alert-recorded-ts:< dateformat >@< zoneformat > where < dateformat > can be any valid Java DateTime format, < zoneformat > can be any valid ZoneId), alert-received-ts (or alert-received-ts:< dateformat > where < dateformat > can be any valid Java DateTime format or alert-received-ts:< dateformat >@< zoneformat > where < dateformat > can be any valid Java DateTime format, < zoneformat > can be any valid ZoneId), device-name, device-id, location-latitude, location-longitude, location-address, location-city, location-zip-code, metadata-< * > (where < * > can be any metadata key). For the elevator product there is also elevator-uri, which is a link to the elevator in the elevator dashboard. Placeholders should be included in double curly braces (e.g. {{alert-name}}). Detailed Java DateTime format documentation. Detailed Java ZoneId format documentation

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Search for email or SMS subscriptions

Searches for subscriptions that match the parameters specified in the query

permissions: subscription.read

Authorizations:
Request Body schema: application/json
contact
string

Either email or phone number

name
string

Case-insensitive accepted.

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Create an SMS subscription

Creates an SMS subscription for the alert severities of the device groups specified in the query. An SMS is sent for every DeviceGroupAlertSet or DeviceGroupAlertClear event happening in the specified groups. SMS messages are also sent for devices included in subgroups of the specified groups.

permissions: subscription.write, live_data.read, device.read, location.read

Authorizations:
Request Body schema: application/json
name
required
string^.{1,256}$

short description for this subscription, will be displayed in UIs

deviceGroupIds
required
Array of strings <uuid> non-empty

ID of the device groups associated with the subscription.

alertCategories
required
Array of strings non-empty
Items Enum: "High" "Medium" "Low"

Incoming alerts are filtered by their severity category before notifications are send. Allowed values can be retrieved from '/alert-severity/mapping'.

phoneNumbers
required
Array of strings non-empty
notifyOnClear
boolean
Default: true

If this flag is false, notifications are only sent when alerts are set.

smsTemplate
string^.{1,2048}$

Template for SMS notifications. It can include the following placeholders: alert-name, alert-display-name, alert-severity, alert-severity-level, alert-message, alert-state, alert-recorded-ts (or alert-recorded-ts:< dateformat > where < dateformat > can be any valid Java DateTime format or alert-recorded-ts:< dateformat >@< zoneformat > where < dateformat > can be any valid Java DateTime format, < zoneformat > can be any valid ZoneId)), alert-received-ts (or alert-received-ts:< dateformat > where < dateformat > can be any valid Java DateTime format or alert-received-ts:< dateformat >@< zoneformat > where < dateformat > can be any valid Java DateTime format, < zoneformat > can be any valid ZoneId)), device-name, device-id, location-latitude, location-longitude, location-address, location-city, location-zip-code, metadata-< * > (where < * > can be any metadata key). For the elevator product there is also elevator-uri, which is a link to the elevator in the elevator dashboard. Placeholders should be included in double curly braces (e.g. {{alert-name}}). Detailed Java DateTime format documentation. Detailed Java ZoneId format documentation

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Delete an SMS subscription

Deletes the SMS subscription specified in the path

permissions: subscription.write

Authorizations:
path Parameters
subscriptionID
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: 000078b3-261e-4025-9d81-b8631d8d0000

ID (UUID) of the subscription

Responses

Response samples

Content type
application/json
{
}

Update an SMS subscription

Updates the SMS subscription specified in the path. See POST /alert-subscriptions/sms-subscriptions endpoint for further details.

permissions: subscription.write, live_data.read, device.read, location.read

Authorizations:
path Parameters
subscriptionID
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: 000078b3-261e-4025-9d81-b8631d8d0000

ID (UUID) of the subscription

Request Body schema: application/json
name
required
string^.{1,256}$

short description for this subscription, will be displayed in UIs

deviceGroupIds
required
Array of strings <uuid> non-empty

ID of the device groups associated with the subscription.

alertCategories
required
Array of strings non-empty
Items Enum: "High" "Medium" "Low"

Incoming alerts are filtered by their severity category before notifications are send. Allowed values can be retrieved from '/alert-severity/mapping'.

phoneNumbers
required
Array of strings non-empty
notifyOnClear
boolean
Default: true

If this flag is false, notifications are only sent when alerts are set.

smsTemplate
string^.{1,2048}$

Template for SMS notifications. It can include the following placeholders: alert-name, alert-display-name, alert-severity, alert-severity-level, alert-message, alert-state, alert-recorded-ts (or alert-recorded-ts:< dateformat > where < dateformat > can be any valid Java DateTime format or alert-recorded-ts:< dateformat >@< zoneformat > where < dateformat > can be any valid Java DateTime format, < zoneformat > can be any valid ZoneId)), alert-received-ts (or alert-received-ts:< dateformat > where < dateformat > can be any valid Java DateTime format or alert-received-ts:< dateformat >@< zoneformat > where < dateformat > can be any valid Java DateTime format, < zoneformat > can be any valid ZoneId)), device-name, device-id, location-latitude, location-longitude, location-address, location-city, location-zip-code, metadata-< * > (where < * > can be any metadata key). For the elevator product there is also elevator-uri, which is a link to the elevator in the elevator dashboard. Placeholders should be included in double curly braces (e.g. {{alert-name}}). Detailed Java DateTime format documentation. Detailed Java ZoneId format documentation

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Monitors - Device

In the relayr Cloud, monitors trigger alerts on devices whenever they stop sending data (e.g. measurement, alert, command response) for a specified amount of time. Triggered alerts are cleared when the device starts receiving data again. The endpoints presented in this section allow you to create and manage monitors for your devices.

NOTE: Monitors do not create alerts, you must first define the alert to trigger in the model of the device to be able to trigger it using a monitor. Go to Entities > Device Models in the left navigation panel for more information on creating alerts.

Return monitors

Returns monitors for the devices specified in the query

permissions: device.read, device_model.read

Authorizations:
query Parameters
deviceIds
string
Example: deviceIds=000078b3-261e-4025-9d81-b8631d8d0000,000078b3-261e-4025-9d81-b8631d8d1111

comma-separated list of deviceIds

enabled
boolean

Filter monitors by their enabled state

Responses

Response samples

Content type
application/json
{
}

Create a monitor

Creates a monitor for the device specified in the request body

permissions: device.read, device_model.read, live_data.read, live_data.write

Authorizations:
Request Body schema: application/json
required
object

Definition of monitor

deviceId
required
string <uuid>

DeviceId the monitor should observe

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Delete a monitor

Deletes the monitor specified in the path

permissions: device.write, live_data.write

Authorizations:
path Parameters
monitorID
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: 000078b3-261e-4025-9d81-b8631d8d0000

The ID of the monitor, which is an UUID

Responses

Response samples

Content type
application/json
{
}

Return a monitor

Returns the monitor specified in the path

permissions: device.read, device_model.read

Authorizations:
path Parameters
monitorID
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: 000078b3-261e-4025-9d81-b8631d8d0000

The ID of the monitor, which is an UUID

Responses

Response samples

Content type
application/json
{
}

Update a monitor

Updates the threshold or alert used by the monitor specified in the path

permissions: device.read, device_model.read

Authorizations:
path Parameters
monitorID
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: 000078b3-261e-4025-9d81-b8631d8d0000

The ID of the monitor, which is an UUID

Request Body schema: application/json
alertMessage
string^.{1,256}$

Message of the alert which should be triggered.

alertName
string

Name of the alert which should be triggered. Must be in device model

enabled
boolean
ignoreAlerts
Array of strings non-empty

It is not recommended to use this setting for devices with more than one monitor. The alerts that should be ignored in the context of monitoring. If any of the listed alerts is generated, the lastSeenAt timestamp of a device won't be updated.

monitorDeviceConnected
boolean
Default: true

It is not recommended to use this setting for devices with more than one monitor. enable/disable the monitoring on connection related event(DeviceSubscribed).

thresholdSec
number multiple of 1 >= 10

How long after device last communicated alert should be triggered (in seconds)

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Device Logs

The endpoint presented in this section lets you search the logs devices send to the Cloud.

Search for device logs (AND)

Searches for device logs matching ALL the parameters specified in the request body. If no parameter is specified, the device logs of all the devices you have access to are returned. It also includes the the error messages published to devices/{deviceId}/errors topic because of malformed message.

permissions: device_log.read, device.read

Authorizations:
query Parameters
limit
string [ 1 .. 50 ] ^\d+$
offset
string >= 0 ^\d+$
Request Body schema: application/json
deviceIds
Array of strings <uuid>
levels
Array of integers <= 6 items unique

An integer from 0 to 5 which represents Critical, Error, Major, Minor, Debug and Trace

message
string

case-insensitive, wildcards (*) accepted

Array of objects
object

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Location - Entity

Locations can be added to devices or device groups in the form of GPS coordinates or a postal address in the relayr Cloud. The endpoints presented in this section allow you to add and delete locations to and from devices and device groups.

Delete a location

Deletes the location of the entity specified in the path. In this endpoint an entity can be a device or a device group.

permissions: location.write, location.read

Authorizations:
path Parameters
entityName
required
string
Enum: "devices" "device-groups"
Example: devices

An entity that can be associated with a location. Currently, this can either be 'devices', or 'device-groups'.

entityId
required
string <uuid>
Example: cea19e58-a633-4963-b29c-31a990587a5f

The id of the entity that is associated with the location needs to be a valid UUID and you must have the necessary permissions for this entity

Responses

Response samples

Content type
application/json
{
}

Return a location

Returns the location of the entity specified in the path. In this endpoint an entity can be a device or a device group.

permissions: location.read

Authorizations:
path Parameters
entityName
required
string
Enum: "devices" "device-groups"
Example: devices

An entity that can be associated with a location. Currently, this can either be 'devices', or 'device-groups'.

entityId
required
string <uuid>
Example: cea19e58-a633-4963-b29c-31a990587a5f

The id of the entity that is associated with the location needs to be a valid UUID and you must have the necessary permissions for this entity

Responses

Response samples

Content type
application/json
{
}

Add or update a location

Adds the location specified in the request body to the entity specified in the path, or updates it. In this endpoint an entity can be a device or a device group. Returns the location if created or updated succesfully.

permissions: location.write, location.read

Authorizations:
path Parameters
entityName
required
string
Enum: "devices" "device-groups"
Example: devices

An entity that can be associated with a location. Currently, this can either be 'devices', or 'device-groups'.

entityId
required
string <uuid>
Example: cea19e58-a633-4963-b29c-31a990587a5f

The id of the entity that is associated with the location needs to be a valid UUID and you must have the necessary permissions for this entity

Request Body schema: application/json

Location object

longitude
required
number [ -180 .. 180 ]

number of degrees east

latitude
required
number [ -90 .. 90 ]

number of degrees north

address
string <= 200 characters

address of device location

city
string

city of device location

country
string

Country code from ISO 3166-1 alpha-2 standard

state
string [ 0 .. 100 ] characters

state of device location

zipCode
string

zipCode of device location

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Configuration - Device

In the relayr Cloud, configurations can be used to set up devices for specific purposes, for example in order to carry out analytics or edge operations. The endpoints presented in this section allow you to create and manage configurations for your devices.

Create a configuration

Creates a configuration for the device specified in the path

permissions: device_config.read, device_config.write, device.read

Authorizations:
path Parameters
deviceId
required
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...
Example: be3faaa1-6165-4439-93b8-ecfb8febc0b7

Device ID

Request Body schema: application/json
object

JSON object describing device configuration

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Return latest configuration

Returns the most recent configuration for the device specified in the path

permissions: device_config.read, device.read

Authorizations:
path Parameters
deviceId
required
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...
Example: be3faaa1-6165-4439-93b8-ecfb8febc0b7

Device ID

Responses

Response samples

Content type
application/json
{
}

Return all configuration versions

Returns all the configuration versions of the device specified in the path

permissions: device_config.read, device.read

Authorizations:
path Parameters
deviceId
required
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...
Example: be3faaa1-6165-4439-93b8-ecfb8febc0b7

Device ID

Responses

Response samples

Content type
application/json
{
}

Return a configuration version

Returns the configuration version specified in the path for the device specified in the path

permissions: device_config.read, device.read

Authorizations:
path Parameters
deviceId
required
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...
Example: be3faaa1-6165-4439-93b8-ecfb8febc0b7

Device ID

version
required
integer
Example: 3

Version number

Responses

Response samples

Content type
application/json
{
}

Create a configuration by deleting a subsection of the latest configuration

Create a configuration by deleting a subsection of the latest configuration for the device and key specified in the path. This will create a new version of the configuration by copying the whole JSON and removing the selected subsection. If there are no configurations for a device, the request will be rejected.

permissions: device_config.read, device_config.write, device.read

Authorizations:
path Parameters
deviceId
required
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...
Example: be3faaa1-6165-4439-93b8-ecfb8febc0b7

Device ID

key
required
string^[-A-Za-z0-9+&@#%$?\[\]=~_|!:,;'()*][-A-Za-z0...
Example: thresholds.battery_v1\.0.voltage

Path to a configuration subsection represented as a dot-separated list of JSON object member names (if a name contains a dot, precede it with "\"). Treated as case-insensitive.

Responses

Response samples

Content type
application/json
{
}

Create a configuration by updating a subsection of the latest configuration

Create a configuration by updating a subsection of the latest configuration for the device and key specified in the path. This will create a new version of the configuration by copying the whole JSON and replacing the selected subsection. If there are no configurations for a device, a new one will be created with a single subsection.

permissions: device_config.read, device_config.write, device.read

Authorizations:
path Parameters
deviceId
required
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...
Example: be3faaa1-6165-4439-93b8-ecfb8febc0b7

Device ID

key
required
string^[-A-Za-z0-9+&@#%$?\[\]=~_|!:,;'()*][-A-Za-z0...
Example: thresholds.battery_v1\.0.voltage

Path to a configuration subsection represented as a dot-separated list of JSON object member names (if a name contains a dot, precede it with "\"). Treated as case-insensitive.

Request Body schema: application/json
object

JSON object describing device configuration subsection

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Get subsection of latest configuration

Get subsection of latest configuration for the specified device and key. If the configuration data doesn't contain the key, a 404 response is returned.

permissions: device_config.read, device.read

Authorizations:
path Parameters
deviceId
required
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...
Example: be3faaa1-6165-4439-93b8-ecfb8febc0b7

Device ID

key
required
string^[-A-Za-z0-9+&@#%$?\[\]=~_|!:,;'()*][-A-Za-z0...
Example: thresholds.battery_v1\.0.voltage

Path to a configuration subsection represented as a dot-separated list of JSON object member names (if a name contains a dot, precede it with "\"). Treated as case-insensitive.

Responses

Response samples

Content type
application/json
{
}

Return versions of a configuration subsection in which that subsection has changed

Returns maximum 5 versions (sorted in descending order) of a configuration subsection specified in the path for the specified device and key. If configuration data doesn't contain the key, a 404 response is returned.

permissions: device_config.read, device.read, user.read

Authorizations:
path Parameters
deviceId
required
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...
Example: be3faaa1-6165-4439-93b8-ecfb8febc0b7

Device ID

key
required
string^[-A-Za-z0-9+&@#%$?\[\]=~_|!:,;'()*][-A-Za-z0...
Example: thresholds.battery_v1\.0.voltage

Path to a configuration subsection represented as a dot-separated list of JSON object member names (if a name contains a dot, precede it with "\"). Treated as case-insensitive.

query Parameters
limit
integer [ 0 .. 5 ]
Default: 5

Pagination limit - maximum number of entities to return

offset
integer >= 0
Default: 0

Pagination offset

withusernames
boolean

If set and true, user's given and family name if available (otherwise email address) will be attached in response.

Responses

Response samples

Content type
application/json
{
}

Return a subsection of a configuration version

Returns the configuration version subsection specified in the path for the specified device and key. If the version doesn't exist or the configuration data doesn't contain the key, a 404 response is returned.

permissions: device_config.read, device.read

Authorizations:
path Parameters
deviceId
required
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...
Example: be3faaa1-6165-4439-93b8-ecfb8febc0b7

Device ID

version
required
integer
Example: 3

Version number

key
required
string^[-A-Za-z0-9+&@#%$?\[\]=~_|!:,;'()*][-A-Za-z0...
Example: thresholds.battery_v1\.0.voltage

Path to a configuration subsection represented as a dot-separated list of JSON object member names (if a name contains a dot, precede it with "\"). Treated as case-insensitive.

Responses

Response samples

Content type
application/json
{
}

Software Installation - Device

The endpoints presented in this section allow you to install required software and software updates on your virtual or physical devices.

NOTE: You must first create a file model of the update before you can create an installation task. Go to Entities > File Models in the left navigation panel for more information on creating file models.

Return installations for a device

Returns the installations existing for the device specified in the path

permissions: installation.read, device.read

Authorizations:
path Parameters
deviceId
required
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...
Example: be3faaa1-6165-4439-93b8-ecfb8febc0b7

Device ID of the task

query Parameters
installationStatus
string
Enum: "unknown" "in_progress" "success" "error"
Example: installationStatus=in_progress

Latest installation status to filter for

deliveryStatus
string
Enum: "pending" "delivered" "timeout" "aborted"
Example: deliveryStatus=delivered

Latest delivery status to filter for

Responses

Response samples

Content type
application/json
{
}

Create an installation

Creates an installation for the device specified in the path

permissions: installation.read, installation.write, device.read, device_model.read, file_model.read

Authorizations:
path Parameters
deviceId
required
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...
Example: be3faaa1-6165-4439-93b8-ecfb8febc0b7

Device ID of the task

Request Body schema: application/json
fileModelId
required
string <UUID> ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...
fileModelVersion
required
integer >= 1
description
string <= 256 characters

Installation description

end
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...

End installation at this point in the future - default 2 hours

start
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...

Start installation at this point in the future - default now

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Delete an installation

Deletes the installation specified in the path

permissions: installation.write, device.read

Authorizations:
path Parameters
deviceId
required
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...
Example: be3faaa1-6165-4439-93b8-ecfb8febc0b7

Device ID of the task

installationId
required
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...
Example: be3faaa1-6165-4439-93b8-ecfb8febc0b7

Installation ID

Responses

Response samples

Content type
application/json
{
}

Return an installation

Returns the installation specified in the path

permissions: installation.read, device.read

Authorizations:
path Parameters
deviceId
required
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...
Example: be3faaa1-6165-4439-93b8-ecfb8febc0b7

Device ID of the task

installationId
required
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...
Example: be3faaa1-6165-4439-93b8-ecfb8febc0b7

Installation ID

query Parameters
installationStatus
string
Enum: "unknown" "in_progress" "success" "error"
Example: installationStatus=in_progress

Latest installation status to filter for

deliveryStatus
string
Enum: "pending" "delivered" "timeout" "aborted"
Example: deliveryStatus=delivered

Latest delivery status to filter for

Responses

Response samples

Content type
application/json
{
}

Update an installation

Updates the installation specified in the path

permissions: installation.read, installation.write, device.read

Authorizations:
path Parameters
deviceId
required
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...
Example: be3faaa1-6165-4439-93b8-ecfb8febc0b7

Device ID of the task

installationId
required
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...
Example: be3faaa1-6165-4439-93b8-ecfb8febc0b7

Installation ID

Request Body schema: application/json
description
string <= 256 characters

Installation description

end
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...

End installation at this point in the future - default 2 hours

start
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...

Start installation at this point in the future - default now

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Cancel an installation

Cancels the installation specified in the path

permissions: installation.read, installation.write, device.read

Authorizations:
path Parameters
deviceId
required
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...
Example: be3faaa1-6165-4439-93b8-ecfb8febc0b7

Device ID of the task

installationId
required
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...
Example: be3faaa1-6165-4439-93b8-ecfb8febc0b7

Installation ID

Responses

Response samples

Content type
application/json
{
}

Return all installations

Returns all installations available in your organization

permissions: installation.read, device.read

Authorizations:
query Parameters
state
string
Enum: "upcoming" "success" "error" "canceled"

Filter for one of four different states that an installation can be in: upcoming - (installationStatus is unknown AND deliveryStatus is pending) OR (installationStatus is in_progress AND deliveryStatus is delivered), success - installationStatus = success AND deliveryStatus = delivered, error - (installationStatus = error AND deliveryStatus = delivered) OR deliveryStatus = timeout, canceled - deliveryStatus = aborted

Responses

Response samples

Content type
application/json
{
}

Return devices with a successful installation

Returns the devices for which the installation associated with the file model specified in the path was successful

permissions: installation.read, device.read

path Parameters
fileModelID
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: 000078b3-261e-4025-9d81-b8631d8d0000

File Model ID (UUID)

query Parameters
installedVersion
required
string
Example: installedVersion=eq+2

File model version filter. Operators supported: eq (equals) and gt (greater than). Filter format: {operator}+{version_value}.

Responses

Response samples

Content type
application/json
{
}

Audit Logs - Device

In the relayr Cloud, device audit logs are lists of actions performed on a device, e.g. device creation, device update, device deletion. An audit log contains information like timestamps and login information related to the entity which performed the action.

The endpoints presented in this section allow you to retrieve audit logs for devices.

Return audit logs for all devices

Returns audit logs for all the devices in your organization. Note: audit logs are only kept for 3 months.

permissions: audit_log.read, device.read

Authorizations:
query Parameters
start
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...
Example: start=2017-09-01T08:00:00+02:00

Beginning of time range (ISO8601) inclusive

end
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...
Example: end=2017-09-01T08:00:00+02:00

End of time range (ISO8601) inclusive

operation
string
Example: operation=DeviceDeleted

Operation to filter for

authEntityId
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: authEntityId=ecbbb77d-b91c-4a33-989d-2d072bb59b68

authorized entity ID that initiated the action

authEntityType
string
Enum: "user" "rule" "device" "device-group"
Example: authEntityType=rule

authorized entity type that initiated the action

Responses

Response samples

Content type
application/json
{
}

Return audit logs for a device

Returns audit logs for the device specified in the path. Note: audit logs are only kept for 3 months.

permissions: audit_log.read, device.read

Authorizations:
path Parameters
deviceId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: ecbbb77d-b91c-4a33-989d-2d072bb59b68

Device ID

query Parameters
start
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...
Example: start=2017-09-01T08:00:00+02:00

Beginning of time range (ISO8601) inclusive

end
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...
Example: end=2017-09-01T08:00:00+02:00

End of time range (ISO8601) inclusive

operation
string
Example: operation=DeviceDeleted

Operation to filter for

authEntityId
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: authEntityId=ecbbb77d-b91c-4a33-989d-2d072bb59b68

authorized entity ID that initiated the action

authEntityType
string
Enum: "user" "rule" "device" "device-group"
Example: authEntityType=rule

authorized entity type that initiated the action

Responses

Response samples

Content type
application/json
{
}

Audit Logs - User

In the relayr Cloud, user audit logs are lists of actions performed on a user, e.g. user creation, user update, user deletion. An audit log contains information like timestamps and login information related to the entity which performed the action.

The endpoints presented in this section allow you to retrieve audit logs for users.

Return audit logs for all users

Returns audit logs for all the users in your organization. Note: audit logs are only kept for 3 months.

permissions: audit_log.read, user.read

Authorizations:
query Parameters
start
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...
Example: start=2017-09-01T08:00:00+02:00

Beginning of time range (ISO8601) inclusive

end
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...
Example: end=2017-09-01T08:00:00+02:00

End of time range (ISO8601) inclusive

operation
string
Example: operation=DeviceDeleted

Operation to filter for

authEntityId
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: authEntityId=ecbbb77d-b91c-4a33-989d-2d072bb59b68

authorized entity ID that initiated the action

authEntityType
string
Enum: "user" "rule" "device" "device-group"
Example: authEntityType=rule

authorized entity type that initiated the action

Responses

Response samples

Content type
application/json
{
}

Return audit logs for a user

Returns audit logs for the user specified in the path. Note: audit logs are only kept for 3 months.

permissions: audit_log.read, user.read

Authorizations:
path Parameters
userId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: ecbbb77d-b91c-4a33-989d-2d072bb59b68

User ID

query Parameters
start
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...
Example: start=2017-09-01T08:00:00+02:00

Beginning of time range (ISO8601) inclusive

end
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...
Example: end=2017-09-01T08:00:00+02:00

End of time range (ISO8601) inclusive

operation
string
Example: operation=DeviceDeleted

Operation to filter for

authEntityId
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: authEntityId=ecbbb77d-b91c-4a33-989d-2d072bb59b68

authorized entity ID that initiated the action

authEntityType
string
Enum: "user" "rule" "device" "device-group"
Example: authEntityType=rule

authorized entity type that initiated the action

Responses

Response samples

Content type
application/json
{
}

Audit Logs - Role

In the relayr Cloud, role audit logs are lists of actions performed on a role, e.g. role creation, role update, role deletion. An audit log contains information like timestamps and login information related to the entity which performed the action.

The endpoints presented in this section allow you to retrieve audit logs for roles.

Return audit logs for all roles

Returns audit logs for all the roles in your organization. Note: audit logs are only kept for 3 months.

permissions: audit_log.read, role.read

Authorizations:
query Parameters
start
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...
Example: start=2017-09-01T08:00:00+02:00

Beginning of time range (ISO8601) inclusive

end
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...
Example: end=2017-09-01T08:00:00+02:00

End of time range (ISO8601) inclusive

operation
string
Example: operation=DeviceDeleted

Operation to filter for

authEntityId
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: authEntityId=ecbbb77d-b91c-4a33-989d-2d072bb59b68

authorized entity ID that initiated the action

authEntityType
string
Enum: "user" "rule" "device" "device-group"
Example: authEntityType=rule

authorized entity type that initiated the action

Responses

Response samples

Content type
application/json
{
}

Return audit logs for a role

Returns audit logs for the role specified for the path. Note: audit logs are only kept for 3 months.

permissions: audit_log.read, role.read

Authorizations:
path Parameters
roleId
required
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: ecbbb77d-b91c-4a33-989d-2d072bb59b68

Role ID

query Parameters
start
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...
Example: start=2017-09-01T08:00:00+02:00

Beginning of time range (ISO8601) inclusive

end
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...
Example: end=2017-09-01T08:00:00+02:00

End of time range (ISO8601) inclusive

operation
string
Example: operation=DeviceDeleted

Operation to filter for

authEntityId
string <uuid> ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89...
Example: authEntityId=ecbbb77d-b91c-4a33-989d-2d072bb59b68

authorized entity ID that initiated the action

authEntityType
string
Enum: "user" "rule" "device" "device-group"
Example: authEntityType=rule

authorized entity type that initiated the action

Responses

Response samples

Content type
application/json
{
}

Experimental

Search for device groups with custom filter

Searches for device groups matching custom filter specified as a value of query parameter. That search filter parameter is obligatory and must be in valid SCIM format.

permissions: device.read, device_group.read, location.read, live_data.read

Authorizations:
query Parameters
filter
required
string
Example: filter=customValue eq "customVal"

SCIM filter translated into ElasticSearch query.

limit
integer [ 1 .. 1000 ]
Default: 10

Pagination limit - maximum number of entities to return

offset
integer [ 0 .. 10000 ]
Default: 0

Pagination offset. offset + limit can not be bigger than the max value configured per setup (default is 10000)

locationbox
boolean
Default: false

If true, the response contains a locationBox field. It's an object with four coordinates which describe boundaries of the area where the devices are located.

Responses

Response samples

Content type
application/json
{
}

Search for devices with custom filter

Searches for devices matching custom filter specified as a value of query parameter. That search filter parameter is obligatory and must be in valid SCIM format.

permissions: device.read, device_group.read, device_model.read, location.read, live_data.read, file_model.read

Authorizations:
query Parameters
filter
required
string
Example: filter=customValue eq "customVal"

SCIM filter translated into ElasticSearch query.

limit
integer [ 1 .. 1000 ]
Default: 10

Pagination limit - maximum number of entities to return

offset
integer [ 0 .. 10000 ]
Default: 0

Pagination offset. offset + limit can not be bigger than the max value configured per setup (default is 10000)

locationbox
boolean
Default: false

If true, the response contains a locationBox field. It's an object with four coordinates which describe boundaries of the area where the devices are located.

Responses

Response samples

Content type
application/json
{
}

Experimental - DO NOT USE

Creates a batch installation

Create batch installation for the devices specified in the request body

permissions: installation.read, installation.write, device.read, device_model.read, file_model.read

Authorizations:
Request Body schema: application/json

Request to create a batch installation for given devices

fileModelId
required
string <UUID> ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...
fileModelVersion
required
integer >= 1
deviceIds
required
Array of strings <UUID>

List of devices should be included in batch installation

batchName
required
string <= 64 characters

User given name to identify a batch installation

end
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...

End installation at this point in the future - default 2 hours

start
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...

Start batch installation at this point in the future - default now

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Return all batch installations

Returns all batch installations to which you have access

permissions: installation.read, file_model.read

Authorizations:
query Parameters
limit
integer [ 1 .. 1000 ]

Pagination limit - maximum number of entities to return

offset
integer >= 0

Pagination offset

Request Body schema: application/json

Search batch installation for given device name and build version

buildVersion
string^(?!\s*$).+
name
string^(?!\s*$).+

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}

Cancels a batch installation

Cancels the batch installation specified in the path

permissions: installation.read, installation.write, device.read

Authorizations:
path Parameters
batchInstallationId
required
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...
Example: be3faaa1-6165-4439-93b8-ecfb8febc0b7

Batch Installation ID

Responses

Response samples

Content type
application/json
{
}

Return installations for a batch

Returns all installations existing for the batch specified in the path

permissions: installation.read, device.read

path Parameters
batchInstallationId
required
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...
Example: be3faaa1-6165-4439-93b8-ecfb8febc0b7

Batch Installation ID

Responses

Response samples

Content type
application/json
{
}

Updates the batch

Updates the batch and all related installations for specified batch with id in the path.

permissions: installation.read, device.read, installation.write

path Parameters
batchInstallationId
required
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...
Example: be3faaa1-6165-4439-93b8-ecfb8febc0b7

Batch Installation ID

Request Body schema: application/json
end
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...

End batch installation at this point in the future - default 2 hours

start
string <date-time> ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2]...

Start batch installation at this point in the future - default now

Responses

Request samples

Content type
application/json
{
}

Response samples

Content type
application/json
{
}