NAV
shell python javascript

Introduction

Welcome to NETIO Cloud API documentation.

The latest API version is running on api.cloud.netio-products.com/. Alternatively you can use api.cloud.netio-products.com/v1/ to use the current version. In future there might be v2 which will eventually end up as the default version.

Authentication

All API requests must be authorized with your organization API token. You can generate this token in the "Settings" tab within your organization. This token is then passed In the Authorization: Bearer {.....} header to all request made to the API. Rate limits are associated with a token.

{ "info": { "title": "Netio Cloud API", "version": "0.1.0", "description": "\n\n*Current rate limits are:*\n\n - 5000 per day\n - 500 per hour\n - 100 per minute\n" }, "tags": [ { "name": "Device" }, { "name": "Directory" }, { "name": "Firmware" }, { "name": "Organization" } ], "paths": { "/device/": { "get": { "parameters": [], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReadDeviceList" } } }, "description": "Successful response" }, "400": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidationError" } } }, "description": "Validation error" } }, "tags": [ "Device" ], "summary": "Get the list of devices and their outputs." } }, "/firmware/": { "get": { "parameters": [ { "in": "query", "name": "serial", "description": "Serial number of the device.", "schema": { "type": "string", "default": "", "writeOnly": true }, "required": false }, { "in": "query", "name": "model", "description": "(e.g.: PowerPDU 3KF", "schema": { "type": "string", "default": "", "writeOnly": true }, "required": false }, { "in": "query", "name": "version", "description": "Current firmware version.", "schema": { "type": "string", "writeOnly": true }, "required": true }, { "in": "query", "name": "latest", "description": "return only latest firmware version.", "schema": { "type": "boolean", "default": false, "writeOnly": true }, "required": false } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReadFirmwareList" } } }, "description": "Successful response" }, "400": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidationError" } } }, "description": "Validation error" } }, "tags": [ "Firmware" ], "summary": "Returns a list of all available firmware versions for a specific device or a model.", "description": "Either serial or combination of serial+model has to be provided.\n\ndownload_url, download_url_no_mcu can be null if the firmware\nvariant is not available for the device.\n\nNo authentication is required." } }, "/directory/": { "post": { "parameters": [], "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DirectoryRead" } } }, "description": "Successful response" }, "400": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidationError" } } }, "description": "Validation error" } }, "tags": [ "Directory" ], "summary": "Create new (sub)directory.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DirectoryCreateRequest" } } } } } }, "/organization/": { "get": { "parameters": [], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OrganizationRead" } } }, "description": "Successful response" } }, "tags": [ "Organization" ], "summary": "Read detailed information about the organization." } }, "/firmware/{name}": { "get": { "parameters": [ { "in": "path", "name": "name", "schema": { "type": "string" }, "required": true }, { "in": "query", "name": "variant", "schema": { "type": "string", "default": null, "writeOnly": true, "nullable": true }, "required": false } ], "responses": { "200": { "content": { "application/json": { "schema": {} } }, "description": "Successful response" }, "400": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidationError" } } }, "description": "Validation error" }, "404": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPError" } } }, "description": "Not found" } }, "tags": [ "Firmware" ], "summary": "Returns the binary firmware file.", "description": "Specify the variant \"no_mcu\" to get the specific version of the firmware.\nIf the firmware name or its variant does not exist, 404 is returned.\n\nNo authentication is required." } }, "/device/{device_id}": { "get": { "parameters": [ { "in": "path", "name": "device_id", "schema": { "type": "string" }, "required": true } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeviceRead" } } }, "description": "Successful response" }, "404": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPError" } } }, "description": "Not found" } }, "tags": [ "Device" ], "summary": "Read Device Information" }, "patch": { "parameters": [ { "in": "path", "name": "device_id", "schema": { "type": "string" }, "required": true } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeviceUpdate" } } }, "description": "Successful response" }, "400": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidationError" } } }, "description": "Validation error" }, "404": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPError" } } }, "description": "Not found" } }, "tags": [ "Device" ], "summary": "Update device information.", "description": "requires the role to have permission DEVICE_MANAGE on the device.\nFor directory transfer the DEVICE_MANAGE permissions is required in the target directory as well.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeviceUpdate" } } } } }, "delete": { "parameters": [ { "in": "path", "name": "device_id", "schema": { "type": "string" }, "required": true } ], "responses": { "204": { "description": "Successful response" }, "404": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPError" } } }, "description": "Not found" } }, "tags": [ "Device" ], "summary": "Remove device from the organization." } }, "/directory/{directory_id}": { "get": { "parameters": [ { "in": "path", "name": "directory_id", "schema": { "type": "string" }, "required": true } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DirectoryRead" } } }, "description": "Successful response" }, "404": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPError" } } }, "description": "Not found" } }, "tags": [ "Directory" ], "summary": "Read Directory Information" }, "patch": { "parameters": [ { "in": "path", "name": "directory_id", "schema": { "type": "string" }, "required": true } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DirectoryUpdate" } } }, "description": "Successful response" }, "400": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidationError" } } }, "description": "Validation error" }, "404": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPError" } } }, "description": "Not found" } }, "tags": [ "Directory" ], "summary": "Update directory information.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DirectoryUpdate" } } } } }, "delete": { "parameters": [ { "in": "path", "name": "directory_id", "schema": { "type": "string" }, "required": true } ], "responses": { "204": { "description": "Successful response" }, "404": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPError" } } }, "description": "Not found" } }, "tags": [ "Directory" ], "summary": "Remove directory from organization." } }, "/directory/{directory_id}/structure": { "get": { "parameters": [ { "in": "path", "name": "directory_id", "schema": { "type": "string" }, "required": true } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DirectoryStructure" } } }, "description": "Successful response" }, "404": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPError" } } }, "description": "Not found" } }, "tags": [ "Directory" ], "summary": "Read Directory Structure" } } }, "openapi": "3.0.3", "components": { "schemas": { "ValidationError": { "properties": { "detail": { "type": "object", "properties": { "": { "type": "object", "properties": { "": { "type": "array", "items": { "type": "string" } } } } } }, "message": { "type": "string" } }, "type": "object" }, "HTTPError": { "properties": { "detail": { "type": "object" }, "message": { "type": "string" } }, "type": "object" }, "DeviceIO": { "type": "object", "properties": { "id": { "type": "string" }, "socket_id": { "type": "string" }, "name": { "type": "string" }, "io_type": { "type": "string" }, "input_mode": { "type": "string" }, "permissions": { "type": "array", "items": { "type": "string" } }, "features": { "type": "object", "additionalProperties": { "type": "boolean" } } } }, "Device": { "type": "object", "properties": { "id": { "type": "string" }, "directory_id": { "type": "string" }, "mqtt_base": { "type": "string" }, "name": { "type": "string" }, "path": { "type": "string" }, "mac": { "type": "string" }, "model": { "type": "string" }, "local_ip": { "type": "string" }, "firmware_version": { "type": "string" }, "permissions": { "type": "array", "items": { "type": "string" } }, "features": { "type": "object", "additionalProperties": { "type": "boolean" } }, "io": { "type": "array", "items": { "$ref": "#/components/schemas/DeviceIO" } } } }, "ReadDeviceList": { "type": "object", "properties": { "items": { "type": "array", "readOnly": true, "items": { "$ref": "#/components/schemas/Device" } }, "total": { "type": "integer", "readOnly": true }, "page": { "type": "integer", "readOnly": true }, "per_page": { "type": "integer", "readOnly": true } } }, "Firmware": { "type": "object", "properties": { "name": { "type": "string" }, "version": { "type": "string" }, "download_url": { "type": "string" }, "download_url_no_mcu": { "type": "string" }, "release_note_cz": { "type": "string" }, "release_note_en": { "type": "string" }, "update_message": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } } } }, "ReadFirmwareList": { "type": "object", "properties": { "items": { "type": "array", "readOnly": true, "items": { "$ref": "#/components/schemas/Firmware" } }, "serial": { "type": "string", "default": "", "writeOnly": true, "description": "Serial number of the device." }, "model": { "type": "string", "default": "", "writeOnly": true, "description": "(e.g.: PowerPDU 3KF" }, "version": { "type": "string", "writeOnly": true, "description": "Current firmware version." }, "latest": { "type": "boolean", "default": false, "writeOnly": true, "description": "return only latest firmware version." } }, "required": [ "version" ] }, "DirectoryCreateRequest": { "type": "object", "properties": { "name": { "type": "string", "maxLength": 140, "description": "Directory name. Should not be duplicate within the where it will be created." }, "parent_id": { "type": "string", "description": "Directory in which to create the new directory. Use \"root\" as shorthand for top level directory." }, "permissions": { "type": "object", "default": {}, "description": "Permissions to set for specified roles in the directory. Other roles are set to inherit from the parent directory. ", "additionalProperties": { "type": "object", "description": "set of permissions for the role. ", "additionalProperties": { "type": "boolean", "nullable": true } } } }, "required": [ "name", "parent_id" ] }, "DirectoryRead": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "ID which uniquely identifies the directory" }, "name": { "type": "string", "description": "Directory name." }, "path": { "type": "string", "description": "Directory full path" }, "parent_id": { "type": "string", "format": "uuid", "description": "parent ID" }, "device_token": { "type": "string", "format": "uuid", "description": "Device registration token for the directory" } } }, "OrganizationSubscription": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Subscription identifier." }, "name": { "type": "string", "description": "Name of the subscription" } } }, "MqttCredentials": { "type": "object", "properties": { "username": { "type": "string", "description": "MQTT username." }, "password": { "type": "string", "description": "MQTT password." }, "hostname": { "type": "string", "description": "MQTT hostname." } } }, "OrganizationRead": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Organizations unique identifier." }, "name": { "type": "string", "description": "Current Organization name." }, "credits": { "type": "integer", "description": "State of the credits in the account." }, "root_directory_id": { "type": "string", "format": "uuid", "description": "Root directory identifier." }, "subscription": { "description": "Current Organization subscription.", "allOf": [ { "$ref": "#/components/schemas/OrganizationSubscription" } ] }, "mqtt": { "description": "MQTT credentials for the organization.", "anyOf": [ { "$ref": "#/components/schemas/MqttCredentials" }, { "type": "object", "nullable": true } ] } } }, "DeviceReadOutput": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "name_on_device": { "type": "string" }, "mqtt_base": { "type": "string" }, "io_id": { "type": "integer" }, "io_type": { "type": "string", "enum": [ "output", "outputZero", "input" ] }, "state": { "type": "integer" }, "consumption": { "type": "integer" }, "load": { "type": "integer" }, "s0_count": { "type": "integer" }, "temp_celsius": { "type": "integer" }, "last_state_ts": { "type": "integer" }, "permissions": { "type": "array", "items": { "type": "string" } }, "features": { "type": "object", "additionalProperties": { "type": "boolean" } } } }, "DeviceRead": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "directory_id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "note": { "type": "string" }, "name_on_device": { "type": "string" }, "path": { "type": "string" }, "mqtt_base": { "type": "string" }, "mac": { "type": "string" }, "model": { "type": "string" }, "local_ip": { "type": "string" }, "firmware_version": { "type": "string" }, "retention": { "type": "boolean" }, "last_activity_ts": { "type": "integer" }, "permissions": { "type": "array", "items": { "type": "string" } }, "features": { "type": "object", "additionalProperties": { "type": "boolean" } }, "outputs": { "type": "array", "items": { "$ref": "#/components/schemas/DeviceReadOutput" } } } }, "DeviceUpdate": { "type": "object", "properties": { "name": { "type": "string", "default": null, "writeOnly": true, "maxLength": 140, "description": "New name of the device", "nullable": true }, "note": { "type": "string", "default": null, "writeOnly": true, "maxLength": 255, "description": "New note", "nullable": true }, "retention": { "type": "boolean", "default": null, "writeOnly": true, "description": "New retention policy", "nullable": true }, "directory_id": { "type": "string", "default": null, "writeOnly": true, "description": "Directory ID to move the device to. Cross-organization move is allowed as well.", "nullable": true }, "permissions": { "type": "object", "default": {}, "writeOnly": true, "description": "Permissions to set for specified roles. Sets permissions only for the roles sent in the request, others are kept as they are.", "additionalProperties": { "type": "object", "writeOnly": true, "description": "set of permissions for the role", "additionalProperties": { "type": "boolean", "nullable": true } } } } }, "DirectoryUpdate": { "type": "object", "properties": { "name": { "type": "string", "default": null, "writeOnly": true, "maxLength": 140, "description": "New directory name", "nullable": true }, "parent_id": { "type": "string", "default": null, "writeOnly": true, "description": "Directory in which to move the directory into", "nullable": true }, "permissions": { "type": "object", "default": {}, "writeOnly": true, "description": "Permissions to set for specified roles in the directory. Sets permissions only for the roles sent in the request.The set can be only a subset of the roles in the directory, when permissions are not specified they are inherited from the parent . ", "additionalProperties": { "type": "object", "writeOnly": true, "description": "set of permissions for the role", "additionalProperties": { "type": "boolean", "nullable": true } } } } }, "DirectoryStructureDevice": { "type": "object", "properties": { "name": { "type": "string", "description": "Name of the device" }, "full_path": { "type": "string", "description": "full directory path" }, "device_id": { "type": "string", "description": "Unique device identification" }, "type_name": { "type": "string", "description": "Type of the device" }, "permissions": { "type": "object", "description": "set of available permissions", "additionalProperties": { "type": "boolean" } } } }, "DirectoryStructure": { "type": "object", "properties": { "name": { "type": "string", "description": "Name of the directory" }, "full_path": { "type": "string", "description": "full directory path" }, "directory_id": { "type": "string", "description": "Unique directory identification" }, "parent_directory_id": { "type": "string", "description": "Unique identification of the parent directory" }, "device_count": { "type": "integer", "description": "Number of devices in the directory" }, "permissions": { "type": "object", "description": "set of available permissions", "additionalProperties": { "type": "boolean" } }, "children": { "type": "array", "description": "List of subdirectories", "items": { "$ref": "#/components/schemas/DirectoryStructure" } }, "devices": { "type": "array", "description": "List of devices in the directory", "items": { "$ref": "#/components/schemas/DirectoryStructureDevice" } } } } }, "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" } } }, "security": [ { "bearerAuth": [] } ] }

app startup: root