NAV Navigation
Shell

IoT Open API Specification v2.0

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Description

Base URLs:

Authentication

Auth

Login

Code samples

# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/auth \
  -H 'Accept: application/json'

POST /api/v2/auth

Log in a user an get a API-Key. Log in is done with username and password. In case of the user setting SMS-Verification on login the API-Key is only valid to update the authentication using a PUT request to the same endpoint with the SMS-Code. In case SMS-Validation is required the nextstep will be "smslogin".

Example responses

200 Response

{
  "token": "2c1914fca4676e201b69bb8d6a24e238"
}

401 Response

{
  "message": "string"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Wrong username or password MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Response Schema

Status Code 200

Name Type Required Restrictions Description
» token string false none The generated token
» nextstep string false none If the user have 2-FA this is what to do next ('smslogin')

2-FA Challenge

Code samples

# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/auth \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

PUT /api/v2/auth

Complete a 2FA login for this user with a user-provided challenge response. Note that this has to be authenticated using the token provided in the initial auth response.

Body parameter

{
  "challenge": "string"
}

Parameters

Name In Type Required Description
body body object false none

Example responses

200 Response

{
  "token": "string"
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Response Schema

Status Code 200

Name Type Required Restrictions Description
» token string false none The generated token

Logout

Code samples

# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/auth \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

DELETE /api/v2/auth

Example responses

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK None
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Reset password

Code samples

# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/auth/reset_password \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

POST /api/v2/auth/reset_password

Send a reset password link to the users email if it exist in the system. The response will always be 200 OK, even when the account is not registered.

Body parameter

{
  "email": "string"
}

Parameters

Name In Type Required Description
body body object true none

Example responses

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK None
500 Internal Server Error Unexpected error MessageResponse

Reset password update

Code samples

# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/auth/reset_password \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: API_KEY'

PUT /api/v2/auth/reset_password

Set a new password using the key from the email.

Body parameter

{
  "password": "string"
}

Parameters

Name In Type Required Description
body body object true none

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Bad Request None

Log

List logs

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/log/{installation_id} \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

GET /api/v2/log/{installation_id}

Fetch a log of historic event on MQTT from sensors. Will show values and the matched functions.

Parameters

Name In Type Required Description
from query integer false Unix time to fetch times from, defaults to now - 24h
to query integer false Maximum unix time for log entry, defaults to now
limit query integer false Maximum number of results, default and max is 10 000. The limit is applied to the result before filtering with matched functions resulting in a smaller set of results after the filter. The limited result will give you the N-amount of latest results.

Example responses

200 Response

[
  {
    "id": 123,
    "function_id": 7,
    "function_type": "switch",
    "log_item_type": "functionx",
    "name": "Livingroom lamp",
    "unit": "",
    "icon": "lamp",
    "alarm_type": "",
    "value": 255,
    "timestamp": 1587713503.385,
    "value_id": "",
    "message": ""
  },
  {
    "id": 657,
    "function_id": 12,
    "function_type": "door",
    "log_item_type": "functionx",
    "name": "Door",
    "unit": "",
    "icon": "door",
    "alarm_type": "",
    "value": 0,
    "timestamp": 1587713433.457,
    "value_id": "",
    "message": ""
  }
]

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [LogEntry] false none none
» id integer false none Unique identifier
» function_id string false none Identifier of function
» function_type string false none Type of function
» log_item_type string false none If the reference function is a FunctionX or legacy Function.
» name string false none Name of the function
» unit string false none DEPRECATED
» icon string false none Icon from the function
» alarm_type string false none DEPRECATED
» value number false none The logged value
» timestamp number false none Time of event using millisecond precision with decimals on Unix timestamp.
» value_id string false none DEPRECATED
» message string false none The msg field of the MQTT message if present

Mobile

Register Phone

Code samples

# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/mobile \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

POST /api/v2/mobile

Register phones firebase token to receive Push

Body parameter

{
  "device_id": "string",
  "firebase_token": "string"
}

Parameters

Name In Type Required Description
body body object true none

Example responses

200 Response

{
  "invalid": [],
  "messages": [],
  "missing": [],
  "mobile": {
    "device_id": "string",
    "firebase_token": "string"
  },
  "valid": true
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Response Schema

Status Code 200

Name Type Required Restrictions Description
» invalid array false none none
» messages array false none none
» missing array false none none
» mobile object true none Matching sent data
»» device_id string true none none
»» firebase_token string true none none
» valid boolean false none none

Get Phones

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/mobile/{user_id} \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

GET /api/v2/mobile/{user_id}

Get all registered firebase tokens for a user with ID. This endpoint can only be used by special system-accounts authenticated with a predefined username and password.

Example responses

200 Response

[
  "string"
]

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Response Schema

FunctionX

List FunctionX

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/functionx/{installation_id} \
  -H 'Accept: application/json'

GET /api/v2/functionx/{installation_id}

List all FunctionX objects for installation. The type determines how this functions is rendered and what meta-keys are to be expected for that rendering. More meta-keys can be added by the user.

Parameters

Name In Type Required Description
{metadata-key} query string false Key => value map to filter functions, wildcard supported in values. Can occur several times.
type query string false Type filter for functionX objects

Example responses

200 Response

[
  {
    "id": 1,
    "installation_id": 1,
    "type": "string",
    "meta": {
      "key1": "string",
      "key2": "string"
    },
    "protected_meta": {
      "key1": "string",
      "key2": "string"
    }
  }
]

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [ModelX] false none none
» id integer false none Identifier
» installation_id integer true none Installations ID
» type string true none Type identifier used to look for meta-data
» meta object true none Key => value storage of all meta-data, may be empty
»» key1 string false none none
»» key2 string false none none
» protected_meta object false none Key => value storage of meta-data that can be restricted access to by permissions.
»» key1 string false none none
»» key2 string false none none

Create FunctionX

Code samples

# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/functionx/{installation_id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

POST /api/v2/functionx/{installation_id}

Body parameter

{
  "installation_id": 1,
  "type": "string",
  "meta": {
    "key1": "string",
    "key2": "string"
  }
}

Parameters

Name In Type Required Description
body body ModelXNoID true none

Example responses

200 Response

{
  "id": 1,
  "installation_id": 1,
  "type": "string",
  "meta": {
    "key1": "string",
    "key2": "string"
  },
  "protected_meta": {
    "key1": "string",
    "key2": "string"
  }
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK ModelX
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Get FunctionX

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/functionx/{installation_id}/{functionx_id} \
  -H 'Accept: application/json'

GET /api/v2/functionx/{installation_id}/{functionx_id}

Example responses

200 Response

{
  "id": 1,
  "installation_id": 1,
  "type": "string",
  "meta": {
    "key1": "string",
    "key2": "string"
  },
  "protected_meta": {
    "key1": "string",
    "key2": "string"
  }
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK ModelX
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Update Functionx

Code samples

# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/functionx/{installation_id}/{functionx_id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

PUT /api/v2/functionx/{installation_id}/{functionx_id}

Body parameter

false

Example responses

200 Response

{
  "id": 1,
  "installation_id": 1,
  "type": "string",
  "meta": {
    "key1": "string",
    "key2": "string"
  },
  "protected_meta": {
    "key1": "string",
    "key2": "string"
  }
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK ModelX
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Delete FunctionX

Code samples

# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/functionx/{installation_id}/{functionx_id} \
  -H 'Accept: application/json'

DELETE /api/v2/functionx/{installation_id}/{functionx_id}

Example responses

200 Response

{
  "message": "Deleted"
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK Resource deleted MessageResponse
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

List Status

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/status/{installation_id} \
  -H 'Accept: application/json'

GET /api/v2/status/{installation_id}

Reports of latest value for all topics reported on this installation. The value and timestamp is the last known state. Please note that it takes approximately 5 seconds for a value to propagate to this list after publishing. This endpoint is used to get initial state on startup of applications.

Parameters

Name In Type Required Description
topics query string false Filter result on specific topic, this parameter can occur more than once inorder to filter on multiple topics

Example responses

200 Response

[
  {
    "client_id": 100,
    "installation_id": 10,
    "timestamp": 1569919769.52,
    "topic": "100/obj/house/hemma/5/temperature",
    "value": 22.1
  },
  {
    "client_id": 100,
    "installation_id": 10,
    "timestamp": 1573667644.385,
    "topic": "100/obj/knx/0/2/4",
    "value": 1
  }
]

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Status] false none none
» client_id number false none Client-ID used on MQTT
» installation_id number false none Installation-ID for the Client-ID in topic
» timestamp number false none Last values unix timestamp. With decimals for milliseconds.
» value number false none Last value
» topic string false none Topic where value was reported

DeviceX

List DeviceX

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/devicex/{installation_id} \
  -H 'Accept: application/json'

GET /api/v2/devicex/{installation_id}

List all DeviceX objects for installation. DeviceX represents the physical device connected to the system. The meta-keys can hold information that are specific to the connection or properties of the device. For example battery-type or connection channel.

Parameters

Name In Type Required Description
{metadata-key} query string false Key => value map to filter functions, wildcard supported in values. Can occur several times.
type query string false Type filter for deviceX objects

Example responses

200 Response

[
  {
    "id": 1,
    "installation_id": 1,
    "type": "string",
    "meta": {
      "key1": "string",
      "key2": "string"
    },
    "protected_meta": {
      "key1": "string",
      "key2": "string"
    }
  }
]

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [ModelX] false none none
» id integer false none Identifier
» installation_id integer true none Installations ID
» type string true none Type identifier used to look for meta-data
» meta object true none Key => value storage of all meta-data, may be empty
»» key1 string false none none
»» key2 string false none none
» protected_meta object false none Key => value storage of meta-data that can be restricted access to by permissions.
»» key1 string false none none
»» key2 string false none none

Create DeviceX

Code samples

# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/devicex/{installation_id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

POST /api/v2/devicex/{installation_id}

Body parameter

{
  "installation_id": 1,
  "type": "string",
  "meta": {
    "key1": "string",
    "key2": "string"
  }
}

Parameters

Name In Type Required Description
body body ModelXNoID true none

Example responses

200 Response

{
  "id": 1,
  "installation_id": 1,
  "type": "string",
  "meta": {
    "key1": "string",
    "key2": "string"
  },
  "protected_meta": {
    "key1": "string",
    "key2": "string"
  }
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK ModelX
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Get DeviceX

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/devicex/{installation_id}/{devicex_id} \
  -H 'Accept: application/json'

GET /api/v2/devicex/{installation_id}/{devicex_id}

Example responses

200 Response

{
  "id": 10,
  "type": "knx",
  "meta": {
    "device_id": 200,
    "manufacturer": "A manufacturer",
    "description": "A sensor"
  }
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK ModelX
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Update DeviceX

Code samples

# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/devicex/{installation_id}/{devicex_id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

PUT /api/v2/devicex/{installation_id}/{devicex_id}

Body parameter

{
  "id": 1,
  "installation_id": 1,
  "type": "string",
  "meta": {
    "key1": "string",
    "key2": "string"
  },
  "protected_meta": {
    "key1": "string",
    "key2": "string"
  }
}

Parameters

Name In Type Required Description
body body ModelX true none

Example responses

200 Response

{
  "id": 1,
  "installation_id": 1,
  "type": "string",
  "meta": {
    "key1": "string",
    "key2": "string"
  },
  "protected_meta": {
    "key1": "string",
    "key2": "string"
  }
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK ModelX
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Delete DeviceX

Code samples

# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/devicex/{installation_id}/{devicex_id} \
  -H 'Accept: application/json'

DELETE /api/v2/devicex/{installation_id}/{devicex_id}

Example responses

200 Response

{
  "message": "Deleted"
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK Resource deleted MessageResponse
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

InstallationInfo

List installations

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/installationinfo \
  -H 'Accept: application/json'

GET /api/v2/installationinfo

Get information about all installations connected to the authenticated user. If the users is an administrator (defined by permissions on the role) all installations for all organizations that the user have access to is returned.

Parameters

Name In Type Required Description
organization_id query number false Filter the result on organization ID. Can be used several times.
assigned query number false Filter result on installations assigned to the current user account. Defaults to true

Example responses

200 Response

[
  {
    "id": 10,
    "name": "First installation",
    "client_id": 1010,
    "organization_id": 2,
    "capabilities": [
      "knx",
      "zwave"
    ]
  },
  {
    "id": 20,
    "name": "Second installation",
    "client_id": 1020,
    "organization_id": 123,
    "capabilities": [
      "zigbee"
    ]
  }
]

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [InstallationInfo] false none none
» capabilities array false none Capabilities of this installation
» client_id integer false none ClientID identifier used on MQTT
» id integer false none Identifier used in API:s
» name string false none none
» organization_id number false none ID of the organization where this installation is placed.

Get Installation Info

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/installationinfo/{client_id} \
  -H 'Accept: application/json'

GET /api/v2/installationinfo///{client_id}

Get installation info for specified client_id.

Example responses

200 Response

{
  "id": 10,
  "name": "First installation",
  "client_id": 1010,
  "capabilities": [
    "knx",
    "zwave"
  ]
}

401 Response

{
  "message": "Unauthorized"
}

403 Response

{
  "message": "Forbidden"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK InstallationInfo
401 Unauthorized Token is invalid or missing MessageResponse
403 Forbidden Not allowed to access that ID. MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Schedule

Create schedule

Code samples

# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/schedule/{installation_id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

POST /api/v2/schedule/{installation_id}

Create schedule, all cron fields defaults to '*' if not in the JSON.

Body parameter

{
  "active": true,
  "created_at": 0,
  "day_of_month": "string",
  "day_of_week": "string",
  "month": "string",
  "hour": "string",
  "id": 0,
  "installation_id": 0,
  "minute": "string",
  "topic": "string",
  "updated_at": "string",
  "value": 0,
  "executor": "string"
}

Parameters

Name In Type Required Description
body body Schedule true none

Example responses

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK None
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

List schedules

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/schedule/{installation_id} \
  -H 'Accept: application/json'

GET /api/v2/schedule/{installation_id}

List all schedules for installation

Parameters

Name In Type Required Description
executor query string false Filter on executors, defaults to "gateway"

Example responses

200 Response

[
  {
    "active": true,
    "created_at": 0,
    "day_of_month": "string",
    "day_of_week": "string",
    "month": "string",
    "hour": "string",
    "id": 0,
    "installation_id": 0,
    "minute": "string",
    "topic": "string",
    "updated_at": "string",
    "value": 0,
    "executor": "string"
  }
]

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Schedule] false none none
» active boolean true none If the schedule is active or not
» created_at integer false none Created date as UNIX-timestamp
» day_of_month string false none Comma separated list of days in a month where schedule is run. Indexed by 0, '*' for all days
» day_of_week string false none Comma separated list of weekdays where schedule is run. Indexed by 0 (sunday is both 0 and 7), '*' for all days
» month string false none Comma separated list of months where the schedule is run. Indexed by 0, '*' fo all months.
» hour string false none Hour of the day in 24-hour format or '*' for every hour
» id number false none Identifier
» installation_id number true none Installation id for the schedule
» minute string false none Minute of the hour or '*' for every minute
» topic string true none The topic to publish value on
» updated_at string false none Updated date as UNIX-timestamp
» value number true none Value to set on topic when schedule is run
» executor string false none Executor that is expected to run the schedule. Defaults to "gateway".

Get Schedule

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/schedule/{installation_id}/{schedule_id} \
  -H 'Accept: application/json'

GET /api/v2/schedule/{installation_id}/{schedule_id}

Get a single schedule on the installation.

Example responses

200 Response

{
  "active": true,
  "created_at": 0,
  "day_of_month": "string",
  "day_of_week": "string",
  "month": "string",
  "hour": "string",
  "id": 0,
  "installation_id": 0,
  "minute": "string",
  "topic": "string",
  "updated_at": "string",
  "value": 0,
  "executor": "string"
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Schedule
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Update Schedule

Code samples

# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/schedule/{installation_id}/{schedule_id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

PUT /api/v2/schedule/{installation_id}/{schedule_id}

Body parameter

{
  "active": true,
  "created_at": 0,
  "day_of_month": "string",
  "day_of_week": "string",
  "month": "string",
  "hour": "string",
  "id": 0,
  "installation_id": 0,
  "minute": "string",
  "topic": "string",
  "updated_at": "string",
  "value": 0,
  "executor": "string"
}

Parameters

Name In Type Required Description
body body Schedule true The new schedule

Example responses

200 Response

{
  "active": true,
  "created_at": 0,
  "day_of_month": "string",
  "day_of_week": "string",
  "month": "string",
  "hour": "string",
  "id": 0,
  "installation_id": 0,
  "minute": "string",
  "topic": "string",
  "updated_at": "string",
  "value": 0,
  "executor": "string"
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Schedule
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Delete Schedule

Code samples

# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/schedule/{installation_id}/{schedule_id} \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

DELETE /api/v2/schedule/{installation_id}/{schedule_id}

Example responses

200 Response

{
  "message": "deleted"
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK MessageResponse
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Permissions

List permissions

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/perimission \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

GET /api/v2/perimission

Retrieve a list of permissions that the authenticated user have. The list is composed of a string identifying the resource being blocked/allowed. The resource follows the pattern of MQTT-topics where '+' and '#' are used as wildcards. Default for permissions not listed should be false. This means that the list is using explicit grant for the operation. Some permissions have the installation-id as prefix. This is for future permission where users may only edit on some installations etc.

The permissions can be used to limit the UI that the user have depending on what is allowed. Permissions are also enforced on the backend in all API-calls.

Example responses

200 Response

{
  "{permission-identifier}": false,
  "functionx/+/add": true,
  "functionx/zwave/add": false,
  "device/#": true
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Response Schema

Status Code 200

Name Type Required Restrictions Description
» {permission-identifier} boolean false none none

Gateway

Gateway Verification

Code samples

# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/gateway/verify/{installation_id} \
  -H 'Accept: application/json'

POST /api/v2/gateway/verify/{installation_id}

Used by gateways to verify their credentials and report capabilities to the backend.

Example responses

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
204 No Content OK (No Content) None
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Reset Gateway Credentials

Code samples

# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/gateway/reset/{installation_id} \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

POST /api/v2/gateway/reset/{installation_id}

Reset the saved credentials for a registered gateway. The gateway will have to renew the credentials to be able to function properly again. This can only be done by the users assigned to the installation that the gateway belongs to.

Example responses

200 Response

{
  "message": "Reset"
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Response Schema

Status Code 200

Name Type Required Restrictions Description
» message string false none none

Get gateway registration policy

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/gateway/registration/policy \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

GET /api/v2/gateway/registration/policy

Gets the current registration policy

Example responses

200 Response

{
  "allow_unregistered": true,
  "default_organization_id": 10
}

403 Response

{
  "message": "Forbidden"
}

Responses

Status Meaning Description Schema
200 OK OK GatewayRegistrationPolicy
403 Forbidden Not allowed to access that ID. MessageResponse

Set gateway registration policy

Code samples

# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/gateway/registration/policy \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

PUT /api/v2/gateway/registration/policy

Updates the current registration policy

Example responses

200 Response

{
  "allow_unregistered": true,
  "default_organization_id": 10
}

403 Response

{
  "message": "Forbidden"
}

Responses

Status Meaning Description Schema
200 OK OK GatewayRegistrationPolicy
403 Forbidden Not allowed to access that ID. MessageResponse

User

Create user

Code samples

# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/user \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

POST /api/v2/user

Create a new user, assign it to organisations and set the users role.

Body parameter

{
  "id": 0,
  "email": "string",
  "first_name": "string",
  "last_name": "string",
  "role": 0,
  "sms_login": true,
  "mobile": "string",
  "note": "string",
  "organisations": [
    0
  ],
  "address": {
    "address": "string",
    "city": "string",
    "country": "string",
    "zip": "string"
  },
  "password": "string",
  "meta": {
    "key1": "string",
    "key2": "string"
  },
  "protected_meta": {
    "key1": "string",
    "key2": "string"
  }
}

Parameters

Name In Type Required Description
body body User true none

Example responses

200 Response

{
  "id": 0,
  "email": "string",
  "first_name": "string",
  "last_name": "string",
  "role": 0,
  "sms_login": true,
  "mobile": "string",
  "note": "string",
  "organisations": [
    0
  ],
  "address": {
    "address": "string",
    "city": "string",
    "country": "string",
    "zip": "string"
  },
  "password": "string",
  "meta": {
    "key1": "string",
    "key2": "string"
  },
  "protected_meta": {
    "key1": "string",
    "key2": "string"
  }
}

400 Response

{
  "message": "'name' can not be empty"
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK User
400 Bad Request Something in the provided data is missing or malformed. MessageResponse
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

List users

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/user \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

GET /api/v2/user

List all users that the authenticated account have access to.

Parameters

Name In Type Required Description
{metadata-key} query string false Key => value map to filter users, wildcard supported in values. Can occur several times.

Example responses

200 Response

[
  {
    "id": 0,
    "email": "string",
    "first_name": "string",
    "last_name": "string",
    "role": 0,
    "sms_login": true,
    "mobile": "string",
    "note": "string",
    "organisations": [
      0
    ],
    "address": {
      "address": "string",
      "city": "string",
      "country": "string",
      "zip": "string"
    },
    "password": "string",
    "meta": {
      "key1": "string",
      "key2": "string"
    },
    "protected_meta": {
      "key1": "string",
      "key2": "string"
    }
  }
]

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [User] false none none
» id number false none Identifier
» email string true none Email address
» first_name string true none First name
» last_name string true none Last name
» role integer true none ID of Role applied to the user, see permissions and roles
» sms_login boolean false none Set to true forces this user to login in with 2FA using SMS
» mobile string false none Mobile phone number for this user
» note string false none A free text field for notes about this user
» organisations [number] true none IDs of organisations that this user belongs to
» address Address true none none
»» address string true none Street address
»» city string true none City name
»» country string true none Country
»» zip string true none Zip code of the address
» password string false none User password, is only valid when creating new users or updating the authenticated user.
» meta object false none Key => value storage of all meta-data, may be empty
»» key1 string false none none
»» key2 string false none none
» protected_meta object false none Key => value storage of meta-data that can be restricted access to by permissions.
»» key1 string false none none
»» key2 string false none none

Get me

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/user/me \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

GET /api/v2/user/me

Get my own user account and information regarding it.

Example responses

200 Response

{
  "id": 2,
  "email": "test@domain.tld",
  "first_name": "Test 2",
  "last_name": "Test",
  "role": 1,
  "sms_login": false,
  "mobile": "01234567890",
  "note": "This is a note",
  "organisations": [
    2
  ],
  "address": {
    "address": "Street 1",
    "city": "Cityname",
    "country": "Sweden",
    "zip": "12345"
  },
  "meta": {
    "key1": "value1",
    "key2": "value2"
  }
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK User
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Delete me

Code samples

# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/user/me \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

DELETE /api/v2/user/me

Delete my own account and remove connections to installations

Example responses

200 Response

{
  "message": "string"
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK MessageResponse
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Get user

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/user/{id} \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

GET /api/v2/user/{id}

Get user and information regarding it

Example responses

200 Response

{
  "id": 2,
  "email": "test@domain.tld",
  "first_name": "Test 2",
  "last_name": "Test",
  "role": 1,
  "sms_login": false,
  "mobile": "01234567890",
  "note": "This is a note",
  "organisations": [
    2
  ],
  "address": {
    "address": "Street 1",
    "city": "Cityname",
    "country": "Sweden",
    "zip": "12345"
  },
  "meta": {
    "key1": "value1",
    "key2": "value2"
  }
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK User
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Delete user

Code samples

# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/user/{id} \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

DELETE /api/v2/user/{id}

Delete user and remove connections to installations

Example responses

200 Response

{
  "message": "string"
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK MessageResponse
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Update Password

Code samples

# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/user/password \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

PUT /api/v2/user/password

Update user password

Body parameter

{
  "current_password": "string",
  "new_password": "string"
}

Parameters

Name In Type Required Description
body body object true none

Example responses

200 Response

{
  "message": "string"
}

400 Response

{
  "message": "'name' can not be empty"
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK MessageResponse
400 Bad Request Something in the provided data is missing or malformed. MessageResponse
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Organization

Create Organization

Code samples

# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/organization \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

POST /api/v2/organization

Create a new organization and put it in the correct place in the tree.

Body parameter

{
  "id": 0,
  "name": "string",
  "address": {
    "address": "string",
    "city": "string",
    "country": "string",
    "zip": "string"
  },
  "email": "string",
  "phone": "string",
  "force_sms_login": true,
  "parent": 0,
  "children": {
    "name": "string",
    "id": 0
  },
  "notes": "string",
  "meta": {
    "key1": "string",
    "key2": "string"
  },
  "protected_meta": {
    "key1": "string",
    "key2": "string"
  }
}

Parameters

Name In Type Required Description
body body Organization true none

Example responses

200 Response

{
  "id": 0,
  "name": "string",
  "address": {
    "address": "string",
    "city": "string",
    "country": "string",
    "zip": "string"
  },
  "email": "string",
  "phone": "string",
  "force_sms_login": true,
  "parent": 0,
  "children": {
    "name": "string",
    "id": 0
  },
  "notes": "string",
  "meta": {
    "key1": "string",
    "key2": "string"
  },
  "protected_meta": {
    "key1": "string",
    "key2": "string"
  }
}

400 Response

{
  "message": "'name' can not be empty"
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Organization
400 Bad Request Something in the provided data is missing or malformed. MessageResponse
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Get organization

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/organization/{id} \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

GET /api/v2/organization/{id}

Get a single organization and the ID:s of its children and parent. Parent is set to 0 if this is the topmost organization that the authenticated account has access to.

Example responses

200 Response

{
  "id": 0,
  "name": "string",
  "address": {
    "address": "string",
    "city": "string",
    "country": "string",
    "zip": "string"
  },
  "email": "string",
  "phone": "string",
  "force_sms_login": true,
  "parent": 0,
  "children": {
    "name": "string",
    "id": 0
  },
  "notes": "string",
  "meta": {
    "key1": "string",
    "key2": "string"
  },
  "protected_meta": {
    "key1": "string",
    "key2": "string"
  }
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Organization
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Update organization

Code samples

# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/organization/{id} \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

PUT /api/v2/organization/{id}

Update parameters for an organization to the provided data

Example responses

200 Response

{
  "id": 2,
  "name": "My org 1",
  "address": {
    "address": "Street 1",
    "city": "Stockholm",
    "country": "Sweden",
    "zip": 12345
  },
  "email": "contact@myorg.com",
  "phone": "07312312345",
  "force_sms_login": false,
  "parent": 1,
  "children": [
    {
      "id": 4,
      "name": "Some name"
    },
    {
      "id": 7,
      "name": "Other org"
    }
  ],
  "notes": "This is my most valued customer",
  "meta": {
    "key1": "value1",
    "key2": "value2"
  }
}

400 Response

{
  "message": "'name' can not be empty"
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Organization
400 Bad Request Something in the provided data is missing or malformed. MessageResponse
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Edge Apps

List Edge Apps

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/edge/app \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

GET /api/v2/edge/app

List of all published apps that this user have access to.

Example responses

200 Response

[
  {
    "id": 0,
    "name": "string",
    "category": "string",
    "tags": [
      "string"
    ],
    "short_description": "string",
    "description": "string",
    "publisher": {
      "name": "string",
      "id": 0
    },
    "official": true,
    "public": true,
    "source_url": "string",
    "created": 0,
    "updated": 0
  }
]

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [EdgeApp] false none none
» id number false none Identifier.
» name string true none Name of the app.
» category string true none The category that the app is placed in.
» tags [string] true none All tags set for this app.
» short_description string true none A shorter description for the app
» description string true none A longer and more detailed description. Markdown format is allowed to do rich text formatting.
» publisher object true none Information about the organization that published the app.
»» name string false none Name of the organization publishing the app
»» id number true none Identifier of the organization
» official boolean false none Set to true if this is an official app.
» public boolean true none If tha app is made for all users or just the provided publisher.
» source_url string false none Where the source code is available online.
» created number false none Unix-timestamp of creation
» updated number false none Unix-timestamp of last modified.

Create Edge App

Code samples

# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/edge/app \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

POST /api/v2/edge/app

Create a new Edge App entry.

Body parameter

{
  "id": 0,
  "name": "string",
  "category": "string",
  "tags": [
    "string"
  ],
  "short_description": "string",
  "description": "string",
  "publisher": {
    "name": "string",
    "id": 0
  },
  "official": true,
  "public": true,
  "source_url": "string",
  "created": 0,
  "updated": 0
}

Parameters

Name In Type Required Description
body body EdgeApp true none

Example responses

200 Response

{
  "id": 0,
  "name": "string",
  "category": "string",
  "tags": [
    "string"
  ],
  "short_description": "string",
  "description": "string",
  "publisher": {
    "name": "string",
    "id": 0
  },
  "official": true,
  "public": true,
  "source_url": "string",
  "created": 0,
  "updated": 0
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK EdgeApp
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Update Edge App

Code samples

# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/edge/app \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

PUT /api/v2/edge/app

Update name, description etc for an edge app

Body parameter

{
  "id": 0,
  "name": "string",
  "category": "string",
  "tags": [
    "string"
  ],
  "short_description": "string",
  "description": "string",
  "publisher": {
    "name": "string",
    "id": 0
  },
  "official": true,
  "public": true,
  "source_url": "string",
  "created": 0,
  "updated": 0
}

Parameters

Name In Type Required Description
body body EdgeApp true none

Example responses

200 Response

{
  "id": 0,
  "name": "string",
  "category": "string",
  "tags": [
    "string"
  ],
  "short_description": "string",
  "description": "string",
  "publisher": {
    "name": "string",
    "id": 0
  },
  "official": true,
  "public": true,
  "source_url": "string",
  "created": 0,
  "updated": 0
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK EdgeApp
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Get Edge App

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/edge/app/{app_id} \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

GET /api/v2/edge/app/{app_id}

Get a single app identified by id.

Example responses

200 Response

{
  "id": 0,
  "name": "string",
  "category": "string",
  "tags": [
    "string"
  ],
  "short_description": "string",
  "description": "string",
  "publisher": {
    "name": "string",
    "id": 0
  },
  "official": true,
  "public": true,
  "source_url": "string",
  "created": 0,
  "updated": 0
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK EdgeApp
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Download Edge App

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/edge/app/{app_id}/download?version=string \
  -H 'Accept: application/json'

GET /api/v2/edge/app/{app_id}/download

Download the executable code for the specified app and version. The response contains all code from the lua-file.

Parameters

Name In Type Required Description
app_id path number true none
version query string true none

Example responses

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK None
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

List Edge App Versions

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/edge/app/{app_id}/version \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

GET /api/v2/edge/app/{app_id}/version

List all versions for the specified app.

Parameters

Name In Type Required Description
app_id path number true none
untagged query boolean false Set to true if all un-named versions should be included

Example responses

200 Response

[
  {
    "name": "string",
    "hash": "string",
    "timestamp": 0
  }
]

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [EdgeAppVersion] false none none
» name string false none Visible name for the version
» hash string true none Hash to set the version name for
» timestamp number false none The unix-timestamp for the upload of the version

Create Edge App Version

Code samples

# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/edge/app/{app_id}/version \
  -H 'Content-Type: multipart/form-data' \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

POST /api/v2/edge/app/{app_id}/version

Create a new (un-named) version of an app.

Body parameter

app_json: string
app_lua: string

Parameters

Name In Type Required Description
app_id path number true none
body body object true none
» app_json body string(binary) false none
» app_lua body string(binary) false none

Example responses

200 Response

{
  "hash": "string"
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
204 No Content No Content. The provided files where identical to the latest on the server. None
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Response Schema

Status Code 200

Name Type Required Restrictions Description
» hash string false none The hash of the new version.

Name Edge App Version

Code samples

# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/edge/app/{app_id}/publish \
  -H 'Content-Type: application/json' \
  -H 'Accept: appication/json' \
  -H 'X-API-Key: API_KEY'

POST /api/v2/edge/app/{app_id}/publish

Set the name of an Edge App version, this makes it available for download and is considered published.

Body parameter

{
  "name": "string",
  "hash": "string",
  "timestamp": 0
}

Parameters

Name In Type Required Description
app_id path number true none
body body EdgeAppVersion true none

Example responses

200 Response

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK EdgeAppVersion
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Get Edge App Configuration Options

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/edge/app/{app_id}/configure?version=string \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

GET /api/v2/edge/app/{app_id}/configure

Fetch the guide configuration options for a specific version of an app. This will return the uploaded app.json file with the options for how this app is going to be configured.

Parameters

Name In Type Required Description
app_id path number true none
version query string true Must be one of the available versions or a hash that don't have a name.

Example responses

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK None
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

List Configured Edge Apps

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/edge/app/configured/{installation_id} \
  -H 'Accept: application/json'

GET /api/v2/edge/app/configured/{installation_id}

List all configured apps for an installation.

Parameters

Name In Type Required Description
installation_id path number true none

Example responses

200 Response

[
  {
    "id": 0,
    "app_id": 0,
    "installation_id": 0,
    "version": "string",
    "config": {},
    "name": "string",
    "created": 0,
    "updated": 0
  }
]

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [EdgeAppConfig] false none none
» id number false none Identifier.
» app_id number true none Identifier of the app being configured.
» installation_id number true none Identifier of the installation being configured.
» version string true none Version number for the app being configured.
» config object true none All config parameters set by the user.
» name string true none User defined name for this instance of the app.
» created number false none Unix-timestamp of creation
» updated number false none Unix-timestamp of last modified.

Create Edge App Instance

Code samples

# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/edge/app/configured/{installation_id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

POST /api/v2/edge/app/configured/{installation_id}

Save a configuration in the backend and inform the gateway that a new app is available for download and run.

Body parameter

{
  "id": 0,
  "app_id": 0,
  "installation_id": 0,
  "version": "string",
  "config": {},
  "name": "string",
  "created": 0,
  "updated": 0
}

Parameters

Name In Type Required Description
installation_id path number true none
body body EdgeAppConfig true none

Example responses

200 Response

{
  "id": 0,
  "app_id": 0,
  "installation_id": 0,
  "version": "string",
  "config": {},
  "name": "string",
  "created": 0,
  "updated": 0
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK EdgeAppConfig
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Get Edge App Instance

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/edge/app/configured/{installation_id}/{instance_id} \
  -H 'Accept: application/json'

GET /api/v2/edge/app/configured/{installation_id}/{instance_id}

Returns a single instance of an app as configured by the user.

Parameters

Name In Type Required Description
installation_id path number true none
instance_id path number true The id of this specific configuration of an app.

Example responses

200 Response

{
  "id": 0,
  "app_id": 0,
  "installation_id": 0,
  "version": "string",
  "config": {},
  "name": "string",
  "created": 0,
  "updated": 0
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK EdgeAppConfig
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Update Edge App Instance

Code samples

# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/edge/app/configured/{installation_id}/{instance_id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

PUT /api/v2/edge/app/configured/{installation_id}/{instance_id}

Update the configured app with new parameters and new values. The update will stop the app and deploy it again on the gateway. If the app-version is changed the new version will be downloaded and replace the old version.

Body parameter

{
  "id": 0,
  "app_id": 0,
  "installation_id": 0,
  "version": "string",
  "config": {},
  "name": "string",
  "created": 0,
  "updated": 0
}

Parameters

Name In Type Required Description
installation_id path number true none
instance_id path number true The id of this specific configuration of an app.
body body EdgeAppConfig true none

Example responses

200 Response

{
  "id": 0,
  "app_id": 0,
  "installation_id": 0,
  "version": "string",
  "config": {},
  "name": "string",
  "created": 0,
  "updated": 0
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK EdgeAppConfig
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Remove Edge App Instance

Code samples

# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/edge/app/configured/{installation_id}/{instance_id} \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

DELETE /api/v2/edge/app/configured/{installation_id}/{instance_id}

Remove the configuration for an app and inform the gateway that the app should be stopped and removed.

Parameters

Name In Type Required Description
installation_id path number true none
instance_id path number true The id of this specific configuration of an app.

Example responses

200 Response

{
  "message": "deleted"
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK MessageResponse
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Roles

List Roles

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/role \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

GET /api/v2/role

Returns a list of all roles that the authenticated user can access.

Example responses

200 Response

[
  {
    "id": 1,
    "name": "string",
    "permissions": {},
    "priority": 0
  }
]

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Role] false none none
» id integer false none Role identifier.
» name string true none Descriptive name of the role.
» permissions object true none Associative map of permission to allowed (true/false).
» priority number true none Limiting access for role assignment.

Create Role

Code samples

# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/role \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

POST /api/v2/role

Create a new Role with a set of permissions.

Body parameter

{
  "id": 1,
  "name": "string",
  "permissions": {},
  "priority": 0
}

Parameters

Name In Type Required Description
body body Role true none

Example responses

200 Response

{
  "id": 1,
  "name": "string",
  "permissions": {},
  "priority": 0
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Role
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Get Role

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/role/{role_id} \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

GET /api/v2/role/{role_id}

Returns a single role identified by role_id

Example responses

200 Response

{
  "id": 1,
  "name": "string",
  "permissions": {},
  "priority": 0
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Role
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Update Role

Code samples

# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/role/{role_id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

PUT /api/v2/role/{role_id}

Update parameters for a role to the provided data

Body parameter

{
  "id": 1,
  "name": "string",
  "permissions": {},
  "priority": 0
}

Parameters

Name In Type Required Description
body body Role true none

Example responses

200 Response

{
  "id": 1,
  "name": "string",
  "permissions": {},
  "priority": 0
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Role
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Delete Role

Code samples

# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/role/{role_id} \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

DELETE /api/v2/role/{role_id}

Delete a role identified by role_id

Example responses

200 Response

{
  "message": "string"
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK MessageResponse
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Notifications

List notification messages

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/notification/{installation_id}/message \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

GET /api/v2/notification/{installation_id}/message

Returns a list of messages for given installation

Example responses

200 Response

[
  {
    "name": "My message",
    "text": "{{.installation.Name}} says: {{.payload.message}}"
  }
]

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [NotificationMessage] false none none
» id integer true none Message identifier.
» name string true none A friendly name for this message.
» text string true none Body of message. Golang templates are supported.

Create notification message

Code samples

# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/notification/{installation_id}/message \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

POST /api/v2/notification/{installation_id}/message

Creates a notification message

Body parameter

{
  "name": "My message",
  "text": "{{.installation.Name}} says: {{.payload.message}}"
}

Parameters

Name In Type Required Description
body body NotificationMessage true none

Example responses

200 Response

{
  "name": "My message",
  "text": "{{.installation.Name}} says: {{.payload.message}}"
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK NotificationMessage
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Get notification message

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/notification/{installation_id}/message/{message_id} \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

GET /api/v2/notification/{installation_id}/message/{message_id}

Returns a message of given id in given installation

Example responses

200 Response

{
  "name": "My message",
  "text": "{{.installation.Name}} says: {{.payload.message}}"
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK NotificationMessage
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Update notification message

Code samples

# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/notification/{installation_id}/message/{message_id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

PUT /api/v2/notification/{installation_id}/message/{message_id}

Updates a notification message

Body parameter

{
  "name": "My message",
  "text": "{{.installation.Name}} says: {{.payload.message}}"
}

Parameters

Name In Type Required Description
body body NotificationMessage true none

Example responses

200 Response

{
  "name": "My message",
  "text": "{{.installation.Name}} says: {{.payload.message}}"
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK NotificationMessage
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Delete notification message

Code samples

# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/notification/{installation_id}/message/{message_id} \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

DELETE /api/v2/notification/{installation_id}/message/{message_id}

Deletes a notification in given installation

Example responses

200 Response

{
  "message": "Deleted"
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK Resource deleted MessageResponse
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

List notification outputs

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/notification/{installation_id}/output \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

GET /api/v2/notification/{installation_id}/output

Returns a list of notification outputs for given installation

Example responses

200 Response

[
  {
    "id": 2,
    "name": "Mail notification",
    "notification_output_executor_id": 1,
    "notification_message_id": 1,
    "config": {
      "recipients": "recipient1@server.com, recipient2@server.com",
      "subject": "{{.installation.ID}} - {{.installation.Name}}"
    }
  }
]

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [NotificationOutput] false none none
» id integer false none Output identifier.
» name string true none A friendly name for this output.
» notification_output_executor_id integer true none References a valid output executor by id
» notification_message_id integer true none References a message by id. Message must refer to a message within the same installation
» installation_id integer false none The installation id this notification is placed in.
» config object true none Key/value storage of all configuration data, may be empty. values is run through the golang templating engine.
»» key1 string false none none
»» key2 string false none none

Create notification output

Code samples

# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/notification/{installation_id}/output \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

POST /api/v2/notification/{installation_id}/output

Creates a notification output. Golang templates are supported in config values

Body parameter

{
  "id": 2,
  "name": "Mail notification",
  "notification_output_executor_id": 1,
  "notification_message_id": 1,
  "config": {
    "recipients": "recipient1@server.com, recipient2@server.com",
    "subject": "{{.installation.ID}} - {{.installation.Name}}"
  }
}

Parameters

Name In Type Required Description
body body NotificationOutput true none

Example responses

200 Response

{
  "id": 2,
  "name": "Mail notification",
  "notification_output_executor_id": 1,
  "notification_message_id": 1,
  "config": {
    "recipients": "recipient1@server.com, recipient2@server.com",
    "subject": "{{.installation.ID}} - {{.installation.Name}}"
  }
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK NotificationOutput
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Get notification output

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/notification/{installation_id}/output/{output_id} \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

GET /api/v2/notification/{installation_id}/output/{output_id}

Returns a notification output of given id in given installation

Example responses

200 Response

{
  "id": 2,
  "name": "Mail notification",
  "notification_output_executor_id": 1,
  "notification_message_id": 1,
  "config": {
    "recipients": "recipient1@server.com, recipient2@server.com",
    "subject": "{{.installation.ID}} - {{.installation.Name}}"
  }
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK NotificationOutput
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Update notification output

Code samples

# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/notification/{installation_id}/output/{output_id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

PUT /api/v2/notification/{installation_id}/output/{output_id}

Updates a notification output

Body parameter

{
  "id": 2,
  "name": "Mail notification",
  "notification_output_executor_id": 1,
  "notification_message_id": 1,
  "config": {
    "recipients": "recipient1@server.com, recipient2@server.com",
    "subject": "{{.installation.ID}} - {{.installation.Name}}"
  }
}

Parameters

Name In Type Required Description
body body NotificationOutput true none

Example responses

200 Response

{
  "id": 2,
  "name": "Mail notification",
  "notification_output_executor_id": 1,
  "notification_message_id": 1,
  "config": {
    "recipients": "recipient1@server.com, recipient2@server.com",
    "subject": "{{.installation.ID}} - {{.installation.Name}}"
  }
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK NotificationOutput
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Delete notification output

Code samples

# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/notification/{installation_id}/output/{output_id} \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

DELETE /api/v2/notification/{installation_id}/output/{output_id}

Deletes a notification output in given installation

Example responses

200 Response

{
  "message": "Deleted"
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK Resource deleted MessageResponse
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

List notification output executors

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/notification/{installation_id}/executor \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

GET /api/v2/notification/{installation_id}/executor

Returns a list of available notification output executors for given installation

Example responses

200 Response

[
  {
    "type": "mail",
    "name": "Mail",
    "organization_id": 1,
    "config": {
      "from": "host@server.com",
      "endpoint": "https://executor.host.tld"
    }
  }
]

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [NotificationOutputExecutor] false none none
» id integer false none Output identifier
» type string true none Type of notifier
» name string true none Name of notifier
» organization_id integer true none The organization id of this notifier
» config object true none Key/value storage of all configuration data. An endpoint key is required as it determines where to forward notification action
»» key1 string false none none
»» key2 string false none none

Get notification output executor

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/notification/{installation_id}/executor/{executor_id} \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

GET /api/v2/notification/{installation_id}/executor/{executor_id}

Returns a notification output executor of given id

Example responses

200 Response

{
  "type": "mail",
  "name": "Mail",
  "organization_id": 1,
  "config": {
    "from": "host@server.com",
    "endpoint": "https://executor.host.tld"
  }
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK NotificationOutputExecutor
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Send notifications

Code samples

# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/notification/{installation_id}/output/{output_id}/send \
  -H 'Accept: application/json'

POST /api/v2/notification/{installation_id}/output/{output_id}/send

Trigger a notification output. If the POST data contains a JSON object it will be available in the templating.

Example responses

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

502 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK None
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse
502 Bad Gateway Unexpected error MessageResponse

Installation

Create Installation

Code samples

# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/installation \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

POST /api/v2/installation

Create installation and information regarding it

Body parameter

{
  "name": "string",
  "organization_id": 0,
  "notes": "string",
  "users": [
    0
  ],
  "meta": {
    "key1": "string",
    "key2": "string"
  },
  "protected_meta": {
    "key1": "string",
    "key2": "string"
  }
}

Parameters

Name In Type Required Description
body body Installation true none

Example responses

200 Response

{
  "id": 0,
  "name": "string",
  "client_id": 0,
  "created": 0,
  "organization_id": 0,
  "notes": "string",
  "users": [
    0
  ],
  "meta": {
    "key1": "string",
    "key2": "string"
  }
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK InstallationResponse
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

List Installation

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/installation \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

GET /api/v2/installation

List of all installations that this user have access to.

Parameters

Name In Type Required Description
{metadata-key} query string false Key => value map to filter installation, wildcard supported in values. Can occur several times.

Example responses

200 Response

{
  "id": 0,
  "name": "string",
  "client_id": 0,
  "created": 0,
  "organization_id": 0,
  "notes": "string",
  "users": [
    0
  ],
  "meta": {
    "key1": "string",
    "key2": "string"
  }
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK InstallationResponse
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Get Installation

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/installation/{installation_id} \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

GET /api/v2/installation/{installation_id}

Returns a single installation identified by installation_id

Example responses

200 Response

{
  "id": 0,
  "name": "string",
  "client_id": 0,
  "created": 0,
  "organization_id": 0,
  "notes": "string",
  "users": [
    0
  ],
  "meta": {
    "key1": "string",
    "key2": "string"
  }
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK InstallationResponse
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Update Installation

Code samples

# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/installation/{installation_id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

PUT /api/v2/installation/{installation_id}

Update parameters for a installation to the provided data

Body parameter

{
  "name": "string",
  "organization_id": 0,
  "notes": "string",
  "users": [
    0
  ],
  "meta": {
    "key1": "string",
    "key2": "string"
  },
  "protected_meta": {
    "key1": "string",
    "key2": "string"
  }
}

Parameters

Name In Type Required Description
body body Installation true none

Example responses

200 Response

{
  "id": 0,
  "name": "string",
  "client_id": 0,
  "created": 0,
  "organization_id": 0,
  "notes": "string",
  "users": [
    0
  ],
  "meta": {
    "key1": "string",
    "key2": "string"
  }
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK InstallationResponse
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Delete Installation

Code samples

# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/installation/{installation_id} \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

DELETE /api/v2/installation/{installation_id}

Delete installation identified by installation_id

Example responses

200 Response

{
  "message": "string"
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK MessageResponse
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

MQTT

MQTT Publish

Code samples

# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/mqtt/publish/{installation_id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

POST /api/v2/mqtt/publish/{installation_id}

Send a message on the MQTT broker on the specified installation.

Body parameter

{
  "topic": "obj/device/1/temperature",
  "payload": {
    "value": 22.1
  }
}

Parameters

Name In Type Required Description
body body MQTTPublish true none

Example responses

200 Response

{
  "message": "string"
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK MessageResponse
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

User registration

Register account

Code samples

# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/user/register \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json'

POST /api/v2/user/register

Register a new account

Body parameter

{
  "email": "string",
  "first_name": "string",
  "last_name": "string",
  "address": {
    "address": "string",
    "city": "string",
    "country": "string",
    "zip": "string"
  }
}

Parameters

Name In Type Required Description
body body UserRegistration true none

Example responses

202 Response

{
  "message": "Registered"
}

400 Response

{
  "message": "'name' can not be empty"
}

403 Response

{
  "message": "Disabled"
}

Responses

Status Meaning Description Schema
202 Accepted Registered MessageResponse
400 Bad Request Something in the provided data is missing or malformed. MessageResponse
403 Forbidden Registration disabled MessageResponse

List registration policies

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/user/registration/policy/{policy_id} \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

GET /api/v2/user/registration/policy/{policy_id}

List all current registration policies

Example responses

200 Response

[
  {
    "id": 0,
    "email_pattern": "string",
    "role_id": 0,
    "parent_organization_id": 0,
    "organization_id": 0
  }
]

403 Response

{
  "message": "Forbidden"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
403 Forbidden Not allowed to access that ID. MessageResponse

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [UserRegistrationPolicy] false none none
» id integer true none Policy id
» email_pattern string true none Wildcard pattern to match registration request emails with
» role_id integer true none Role to give the new user
» parent_organization_id integer false none If this field is set; create a new organization under parent organization for the new user
» organization_id integer false none If parent_organization_id is not set, the new user will be put into this organization

Delete registration policy

Code samples

# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/user/registration/policy/{policy_id} \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

DELETE /api/v2/user/registration/policy/{policy_id}

Delete a registration policy

Example responses

200 Response

{
  "message": "Deleted"
}

Responses

Status Meaning Description Schema
200 OK Resource deleted MessageResponse

Update registration policy

Code samples

# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/user/registration/policy/{policy_id} \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

PUT /api/v2/user/registration/policy/{policy_id}

Update a registration policy

Example responses

200 Response

{
  "id": 0,
  "email_pattern": "string",
  "role_id": 0,
  "parent_organization_id": 0,
  "organization_id": 0
}

400 Response

{
  "message": "'name' can not be empty"
}

403 Response

{
  "message": "Forbidden"
}

Responses

Status Meaning Description Schema
200 OK OK UserRegistrationPolicy
400 Bad Request Something in the provided data is missing or malformed. MessageResponse
403 Forbidden Not allowed to access that ID. MessageResponse

Create registration policy

Code samples

# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/user/registration/policy \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

POST /api/v2/user/registration/policy

Create a new registration policy. A policy determines which organization and role a new registered user will end up.

Email patterns are wildcards, and the most specific matching policy will chosen when registering new users.

registering with admin@iotopen.se will match admin@iotopen.se over *@iotopen.se

With this policy configuration would a registration with

Registration policies can also say that the new user should be created with their own organization under a specified organization, like so:

with this policy configuration would a registration with

Body parameter

{
  "id": 0,
  "email_pattern": "string",
  "role_id": 0,
  "parent_organization_id": 0,
  "organization_id": 0
}

Parameters

Name In Type Required Description
body body UserRegistrationPolicy true none

Example responses

200 Response

{
  "id": 0,
  "email_pattern": "string",
  "role_id": 0,
  "parent_organization_id": 0,
  "organization_id": 0
}

403 Response

{
  "message": "Forbidden"
}

Responses

Status Meaning Description Schema
200 OK OK UserRegistrationPolicy
403 Forbidden Not allowed to access that ID. MessageResponse

File

List files (installation)

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/file/installation/{installation_id} \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

GET /api/v2/file/installation/{installation_id}

Returns a list of all files belonging to installation with installation_id.

Parameters

Name In Type Required Description
mime query string false Filter the result on specified mime type, wildcards allowed

Example responses

200 Response

[
  {
    "id": 0,
    "hash": "string",
    "name": "string",
    "mime": "string",
    "installation_id": 0,
    "organization_id": 0,
    "updated": 0,
    "created": 0
  }
]

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [File] false none none
» id number false none Identifier.
» hash string false none The sha256 sum of the uploaded file.
» name string false none The filename.
» mime string false none Mime type of the file when uploaded.
» installation_id number false none If the file is uploaded to an installation this is the installation ID.
» organization_id number false none If the file is uploaded to an organization this is the organization ID.
» updated number false none Unix timestamp for last updated time.
» created number false none Unix timestamp for created time.

Create File (installation)

Code samples

# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/file/installation/{installation_id} \
  -H 'Content-Type: multipart/form-data' \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

POST /api/v2/file/installation/{installation_id}

Create one or several new files on an installation.

Body parameter

filename:
  - string

Parameters

Name In Type Required Description
body body object true none
» filename body [string] true Multipart file inclusion. Each item needs the Content-Type header to be set.

Example responses

200 Response

[
  {
    "id": 0,
    "hash": "string",
    "name": "string",
    "mime": "string",
    "installation_id": 0,
    "organization_id": 0,
    "updated": 0,
    "created": 0
  }
]

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [File] false none none
» id number false none Identifier.
» hash string false none The sha256 sum of the uploaded file.
» name string false none The filename.
» mime string false none Mime type of the file when uploaded.
» installation_id number false none If the file is uploaded to an installation this is the installation ID.
» organization_id number false none If the file is uploaded to an organization this is the organization ID.
» updated number false none Unix timestamp for last updated time.
» created number false none Unix timestamp for created time.

Get File (installation)

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/file/installation/{installation_id}/{file_id} \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

GET /api/v2/file/installation/{installation_id}/{file_id}

Returns a single file on an installation if it exists. Identified with file_id.

Example responses

200 Response

{
  "id": 0,
  "hash": "string",
  "name": "string",
  "mime": "string",
  "installation_id": 0,
  "organization_id": 0,
  "updated": 0,
  "created": 0
}

401 Response

{
  "message": "Unauthorized"
}

403 Response

{
  "message": "Forbidden"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK File
401 Unauthorized Token is invalid or missing MessageResponse
403 Forbidden Not allowed to access that ID. MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Update File (installation)

Code samples

# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/file/installation/{installation_id}/{file_id} \
  -H 'Content-Type: multipart/form-data' \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

PUT /api/v2/file/installation/{installation_id}/{file_id}

Update a file, the Content-Type must be the same. File with ID is updated in disk.

Body parameter

filename: string

Parameters

Name In Type Required Description
body body object true none
» filename body string(binary) true none

Example responses

200 Response

{
  "id": 0,
  "hash": "string",
  "name": "string",
  "mime": "string",
  "installation_id": 0,
  "organization_id": 0,
  "updated": 0,
  "created": 0
}

Responses

Status Meaning Description Schema
200 OK OK File

Delete File (installation)

Code samples

# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/file/installation/{installation_id}/{file_id} \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

DELETE /api/v2/file/installation/{installation_id}/{file_id}

Remove a file belonging to an installation.

Example responses

200 Response

{
  "message": "Deleted"
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK Resource deleted MessageResponse
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

List files (organization)

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/file/organization/{organization_id} \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

GET /api/v2/file/organization/{organization_id}

Returns a list of all files belonging to organization with organization_id

Parameters

Name In Type Required Description
mime query string false Filter the result on specified mime type, wildcards allowed

Example responses

200 Response

[
  {
    "id": 0,
    "hash": "string",
    "name": "string",
    "mime": "string",
    "installation_id": 0,
    "organization_id": 0,
    "updated": 0,
    "created": 0
  }
]

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [File] false none none
» id number false none Identifier.
» hash string false none The sha256 sum of the uploaded file.
» name string false none The filename.
» mime string false none Mime type of the file when uploaded.
» installation_id number false none If the file is uploaded to an installation this is the installation ID.
» organization_id number false none If the file is uploaded to an organization this is the organization ID.
» updated number false none Unix timestamp for last updated time.
» created number false none Unix timestamp for created time.

Create File (organization)

Code samples

# You can also use wget
curl -X POST https://lynx.iotopen.se/api/v2/file/organization/{organization_id} \
  -H 'Content-Type: multipart/form-data' \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

POST /api/v2/file/organization/{organization_id}

Create one or several new files on an organization.

Body parameter

filename:
  - string

Parameters

Name In Type Required Description
body body object true none
» filename body [string] true Multipart file inclusion. Each item needs the Content-Type header to be set.

Example responses

200 Response

[
  {
    "id": 0,
    "hash": "string",
    "name": "string",
    "mime": "string",
    "installation_id": 0,
    "organization_id": 0,
    "updated": 0,
    "created": 0
  }
]

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [File] false none none
» id number false none Identifier.
» hash string false none The sha256 sum of the uploaded file.
» name string false none The filename.
» mime string false none Mime type of the file when uploaded.
» installation_id number false none If the file is uploaded to an installation this is the installation ID.
» organization_id number false none If the file is uploaded to an organization this is the organization ID.
» updated number false none Unix timestamp for last updated time.
» created number false none Unix timestamp for created time.

Get File (organization)

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/file/organization/{organization_id}/{file_id} \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

GET /api/v2/file/organization/{organization_id}/{file_id}

Returns a single file on an organization if it exists. Identified with file_id.

Example responses

200 Response

{
  "id": 0,
  "hash": "string",
  "name": "string",
  "mime": "string",
  "installation_id": 0,
  "organization_id": 0,
  "updated": 0,
  "created": 0
}

401 Response

{
  "message": "Unauthorized"
}

403 Response

{
  "message": "Forbidden"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK File
401 Unauthorized Token is invalid or missing MessageResponse
403 Forbidden Not allowed to access that ID. MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Update File (organization)

Code samples

# You can also use wget
curl -X PUT https://lynx.iotopen.se/api/v2/file/organization/{organization_id}/{file_id} \
  -H 'Content-Type: multipart/form-data' \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

PUT /api/v2/file/organization/{organization_id}/{file_id}

Update a file, the Content-Type must be the same. File with ID is updated in disk.

Body parameter

filename: string

Parameters

Name In Type Required Description
body body object true none
» filename body string(binary) true none

Example responses

200 Response

{
  "id": 0,
  "hash": "string",
  "name": "string",
  "mime": "string",
  "installation_id": 0,
  "organization_id": 0,
  "updated": 0,
  "created": 0
}

Responses

Status Meaning Description Schema
200 OK OK File

Delete File (organization)

Code samples

# You can also use wget
curl -X DELETE https://lynx.iotopen.se/api/v2/file/organization/{organization_id}/{file_id} \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

DELETE /api/v2/file/organization/{organization_id}/{file_id}

Remove a file belonging to an organization.

Example responses

200 Response

{
  "message": "Deleted"
}

401 Response

{
  "message": "Unauthorized"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK Resource deleted MessageResponse
401 Unauthorized Token is invalid or missing MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Download File

Code samples

# You can also use wget
curl -X GET https://lynx.iotopen.se/api/v2/file/download/{hash} \
  -H 'Accept: application/json'

GET /api/v2/file/download/{hash}

Download a file. Accepted format can be specified with the Accept header.

Example responses

401 Response

{
  "message": "Unauthorized"
}

403 Response

{
  "message": "Forbidden"
}

500 Response

{
  "message": "Internal Server Error"
}

Responses

Status Meaning Description Schema
200 OK OK None
401 Unauthorized Token is invalid or missing MessageResponse
403 Forbidden Not allowed to access that ID. MessageResponse
500 Internal Server Error Unexpected error MessageResponse

Schemas

MessageResponse

{
  "message": "string"
}

Properties

Name Type Required Restrictions Description
message string false none none

ModelX

{
  "id": 1,
  "installation_id": 1,
  "type": "string",
  "meta": {
    "key1": "string",
    "key2": "string"
  },
  "protected_meta": {
    "key1": "string",
    "key2": "string"
  }
}

Properties

Name Type Required Restrictions Description
id integer false none Identifier
installation_id integer true none Installations ID
type string true none Type identifier used to look for meta-data
meta object true none Key => value storage of all meta-data, may be empty
» key1 string false none none
» key2 string false none none
protected_meta object false none Key => value storage of meta-data that can be restricted access to by permissions.
» key1 string false none none
» key2 string false none none

ModelXNoID

{
  "installation_id": 1,
  "type": "string",
  "meta": {
    "key1": "string",
    "key2": "string"
  }
}

Properties

Name Type Required Restrictions Description
installation_id integer true none Installations ID
type string true none Type identifier used to look for meta-data
meta object true none Key => value storage of all meta-data, may be empty
» key1 string false none none
» key2 string false none none

InstallationInfo

{
  "capabilities": [],
  "client_id": 1,
  "id": 1,
  "name": "string",
  "organization_id": 0
}

Properties

Name Type Required Restrictions Description
capabilities array false none Capabilities of this installation
client_id integer false none ClientID identifier used on MQTT
id integer false none Identifier used in API:s
name string false none none
organization_id number false none ID of the organization where this installation is placed.

Installation

{
  "name": "string",
  "organization_id": 0,
  "notes": "string",
  "users": [
    0
  ],
  "meta": {
    "key1": "string",
    "key2": "string"
  },
  "protected_meta": {
    "key1": "string",
    "key2": "string"
  }
}

Properties

Name Type Required Restrictions Description
name string true none Descriptive name of the installation
organization_id integer true none ID of the organization where this installation is placed
notes string true none none
users [integer] true none User IDs associated with this installation
meta object false none Key => value storage of all meta-data, may be empty
» key1 string false none none
» key2 string false none none
protected_meta object false none Key => value storage of meta-data that can be restricted access to by permissions.
» key1 string false none none
» key2 string false none none

InstallationResponse

{
  "id": 0,
  "name": "string",
  "client_id": 0,
  "created": 0,
  "organization_id": 0,
  "notes": "string",
  "users": [
    0
  ],
  "meta": {
    "key1": "string",
    "key2": "string"
  }
}

Properties

Name Type Required Restrictions Description
id integer false none Installation identifier
name string true none Descriptive name of the installation
client_id integer false none identifier used on MQTT
created integer false none Unix-timestamp of creation
organization_id integer true none ID of the organization where this installation is placed
notes string true none none
users [integer] true none All user IDs associated with this installation
meta object false none Key => value storage of all meta-data, may be empty
» key1 string false none none
» key2 string false none none

Schedule

{
  "active": true,
  "created_at": 0,
  "day_of_month": "string",
  "day_of_week": "string",
  "month": "string",
  "hour": "string",
  "id": 0,
  "installation_id": 0,
  "minute": "string",
  "topic": "string",
  "updated_at": "string",
  "value": 0,
  "executor": "string"
}

Properties

Name Type Required Restrictions Description
active boolean true none If the schedule is active or not
created_at integer false none Created date as UNIX-timestamp
day_of_month string false none Comma separated list of days in a month where schedule is run. Indexed by 0, '*' for all days
day_of_week string false none Comma separated list of weekdays where schedule is run. Indexed by 0 (sunday is both 0 and 7), '*' for all days
month string false none Comma separated list of months where the schedule is run. Indexed by 0, '*' fo all months.
hour string false none Hour of the day in 24-hour format or '*' for every hour
id number false none Identifier
installation_id number true none Installation id for the schedule
minute string false none Minute of the hour or '*' for every minute
topic string true none The topic to publish value on
updated_at string false none Updated date as UNIX-timestamp
value number true none Value to set on topic when schedule is run
executor string false none Executor that is expected to run the schedule. Defaults to "gateway".

Resource

{
  "content_id": "string",
  "formats": {
    "wav": "0d00f828a9770839f382e88bac751b4c"
  },
  "language": "string",
  "mime": "string",
  "name": "string",
  "uuid": "string"
}

Properties

Name Type Required Restrictions Description
content_id string false none Identifier for object in all languages
formats object false none Formats already transcoded for this resource and their MD5-sum
» {format} string false none The MD5-sum of this resource in that format
language string false none Language code that this resource is in, default 'en'
mime string false none MIME type of the resource
name string false none Name of the resource translated to locale
uuid string false none Unique identifier for this resource

Status

{
  "client_id": 0,
  "installation_id": 0,
  "timestamp": 0,
  "value": 0,
  "topic": "string"
}

Properties

Name Type Required Restrictions Description
client_id number false none Client-ID used on MQTT
installation_id number false none Installation-ID for the Client-ID in topic
timestamp number false none Last values unix timestamp. With decimals for milliseconds.
value number false none Last value
topic string false none Topic where value was reported

User

{
  "id": 0,
  "email": "string",
  "first_name": "string",
  "last_name": "string",
  "role": 0,
  "sms_login": true,
  "mobile": "string",
  "note": "string",
  "organisations": [
    0
  ],
  "address": {
    "address": "string",
    "city": "string",
    "country": "string",
    "zip": "string"
  },
  "password": "string",
  "meta": {
    "key1": "string",
    "key2": "string"
  },
  "protected_meta": {
    "key1": "string",
    "key2": "string"
  }
}

Properties

Name Type Required Restrictions Description
id number false none Identifier
email string true none Email address
first_name string true none First name
last_name string true none Last name
role integer true none ID of Role applied to the user, see permissions and roles
sms_login boolean false none Set to true forces this user to login in with 2FA using SMS
mobile string false none Mobile phone number for this user
note string false none A free text field for notes about this user
organisations [number] true none IDs of organisations that this user belongs to
address Address true none none
password string false none User password, is only valid when creating new users or updating the authenticated user.
meta object false none Key => value storage of all meta-data, may be empty
» key1 string false none none
» key2 string false none none
protected_meta object false none Key => value storage of meta-data that can be restricted access to by permissions.
» key1 string false none none
» key2 string false none none

LogEntry

{
  "id": 0,
  "function_id": "string",
  "function_type": "string",
  "log_item_type": "string",
  "name": "string",
  "unit": "string",
  "icon": "string",
  "alarm_type": "string",
  "value": 0,
  "timestamp": 0,
  "value_id": "string",
  "message": "string"
}

Properties

Name Type Required Restrictions Description
id integer false none Unique identifier
function_id string false none Identifier of function
function_type string false none Type of function
log_item_type string false none If the reference function is a FunctionX or legacy Function.
name string false none Name of the function
unit string false none DEPRECATED
icon string false none Icon from the function
alarm_type string false none DEPRECATED
value number false none The logged value
timestamp number false none Time of event using millisecond precision with decimals on Unix timestamp.
value_id string false none DEPRECATED
message string false none The msg field of the MQTT message if present

Address

{
  "address": "string",
  "city": "string",
  "country": "string",
  "zip": "string"
}

Properties

Name Type Required Restrictions Description
address string true none Street address
city string true none City name
country string true none Country
zip string true none Zip code of the address

Organization

{
  "id": 0,
  "name": "string",
  "address": {
    "address": "string",
    "city": "string",
    "country": "string",
    "zip": "string"
  },
  "email": "string",
  "phone": "string",
  "force_sms_login": true,
  "parent": 0,
  "children": {
    "name": "string",
    "id": 0
  },
  "notes": "string",
  "meta": {
    "key1": "string",
    "key2": "string"
  },
  "protected_meta": {
    "key1": "string",
    "key2": "string"
  }
}

Properties

Name Type Required Restrictions Description
id number false none Identifier.
name string true none Name
address Address true none none
email string false none Contact email for the organization.
phone string false none Contact phone number for the organization.
force_sms_login boolean true none Force all users belonging to this organization to use SMS-Login.
parent number true none ID of the parent organization, will be set to 0 if this is the root of what the current authenticated account can view.
children object false none A list of all direct child organizations with name and ID.
» name string false none Name of the child organization.
» id number false none ID of the child organization.
notes string false none Free text notes for organization
meta object false none Key => value storage of all meta-data, may be empty
» key1 string false none none
» key2 string false none none
protected_meta object false none Key => value storage of meta-data that can be restricted access to by permissions.
» key1 string false none none
» key2 string false none none

EdgeApp

{
  "id": 0,
  "name": "string",
  "category": "string",
  "tags": [
    "string"
  ],
  "short_description": "string",
  "description": "string",
  "publisher": {
    "name": "string",
    "id": 0
  },
  "official": true,
  "public": true,
  "source_url": "string",
  "created": 0,
  "updated": 0
}

Properties

Name Type Required Restrictions Description
id number false none Identifier.
name string true none Name of the app.
category string true none The category that the app is placed in.
tags [string] true none All tags set for this app.
short_description string true none A shorter description for the app
description string true none A longer and more detailed description. Markdown format is allowed to do rich text formatting.
publisher object true none Information about the organization that published the app.
» name string false none Name of the organization publishing the app
» id number true none Identifier of the organization
official boolean false none Set to true if this is an official app.
public boolean true none If tha app is made for all users or just the provided publisher.
source_url string false none Where the source code is available online.
created number false none Unix-timestamp of creation
updated number false none Unix-timestamp of last modified.

EdgeAppConfig

{
  "id": 0,
  "app_id": 0,
  "installation_id": 0,
  "version": "string",
  "config": {},
  "name": "string",
  "created": 0,
  "updated": 0
}

Properties

Name Type Required Restrictions Description
id number false none Identifier.
app_id number true none Identifier of the app being configured.
installation_id number true none Identifier of the installation being configured.
version string true none Version number for the app being configured.
config object true none All config parameters set by the user.
name string true none User defined name for this instance of the app.
created number false none Unix-timestamp of creation
updated number false none Unix-timestamp of last modified.

EdgeAppVersion

{
  "name": "string",
  "hash": "string",
  "timestamp": 0
}

Properties

Name Type Required Restrictions Description
name string false none Visible name for the version
hash string true none Hash to set the version name for
timestamp number false none The unix-timestamp for the upload of the version

Role

{
  "id": 1,
  "name": "string",
  "permissions": {},
  "priority": 0
}

Properties

Name Type Required Restrictions Description
id integer false none Role identifier.
name string true none Descriptive name of the role.
permissions object true none Associative map of permission to allowed (true/false).
priority number true none Limiting access for role assignment.

NotificationMessage

{
  "name": "My message",
  "text": "{{.installation.Name}} says: {{.payload.message}}"
}

Properties

Name Type Required Restrictions Description
id integer true none Message identifier.
name string true none A friendly name for this message.
text string true none Body of message. Golang templates are supported.

NotificationOutput

{
  "id": 2,
  "name": "Mail notification",
  "notification_output_executor_id": 1,
  "notification_message_id": 1,
  "config": {
    "recipients": "recipient1@server.com, recipient2@server.com",
    "subject": "{{.installation.ID}} - {{.installation.Name}}"
  }
}

Properties

Name Type Required Restrictions Description
id integer false none Output identifier.
name string true none A friendly name for this output.
notification_output_executor_id integer true none References a valid output executor by id
notification_message_id integer true none References a message by id. Message must refer to a message within the same installation
installation_id integer false none The installation id this notification is placed in.
config object true none Key/value storage of all configuration data, may be empty. values is run through the golang templating engine.
» key1 string false none none
» key2 string false none none

NotificationOutputExecutor

{
  "type": "mail",
  "name": "Mail",
  "organization_id": 1,
  "config": {
    "from": "host@server.com",
    "endpoint": "https://executor.host.tld"
  }
}

Properties

Name Type Required Restrictions Description
id integer false none Output identifier
type string true none Type of notifier
name string true none Name of notifier
organization_id integer true none The organization id of this notifier
config object true none Key/value storage of all configuration data. An endpoint key is required as it determines where to forward notification action
» key1 string false none none
» key2 string false none none

MQTTPublish

{
  "topic": "obj/device/1/temperature",
  "payload": {
    "value": 22.1
  }
}

Properties

Name Type Required Restrictions Description
topic string true none The topic to publish on for the installation
qos integer false none QoS of the MQTT message, see MQTT Specification
retained boolean false none Retain flag of the MQTT message, see MQTT Specification
payload object true none The mqtt payload object in JSON format

UserRegistration

{
  "email": "string",
  "first_name": "string",
  "last_name": "string",
  "address": {
    "address": "string",
    "city": "string",
    "country": "string",
    "zip": "string"
  }
}

Properties

Name Type Required Restrictions Description
email string true none Email of new user
first_name string true none Users first name
last_name string true none Users last name
address Address true none none

UserRegistrationPolicy

{
  "id": 0,
  "email_pattern": "string",
  "role_id": 0,
  "parent_organization_id": 0,
  "organization_id": 0
}

Properties

Name Type Required Restrictions Description
id integer true none Policy id
email_pattern string true none Wildcard pattern to match registration request emails with
role_id integer true none Role to give the new user
parent_organization_id integer false none If this field is set; create a new organization under parent organization for the new user
organization_id integer false none If parent_organization_id is not set, the new user will be put into this organization

GatewayRegistrationPolicy

{
  "allow_unregistered": true,
  "default_organization_id": 10
}

Properties

Name Type Required Restrictions Description
allow_unregistered boolean true none whether to allow new previously unregistered gateways to register
default_organization_id number true none the organization id which new gateways are assigned to

File

{
  "id": 0,
  "hash": "string",
  "name": "string",
  "mime": "string",
  "installation_id": 0,
  "organization_id": 0,
  "updated": 0,
  "created": 0
}

Properties

Name Type Required Restrictions Description
id number false none Identifier.
hash string false none The sha256 sum of the uploaded file.
name string false none The filename.
mime string false none Mime type of the file when uploaded.
installation_id number false none If the file is uploaded to an installation this is the installation ID.
organization_id number false none If the file is uploaded to an organization this is the organization ID.
updated number false none Unix timestamp for last updated time.
created number false none Unix timestamp for created time.