Crear Variable

Este endpoint crea una nueva Variable.

Solicitud HTTP

Para crear una sola Variable, haz una petición POST a la siguiente URL:


Para crear una nueva Variable de un Device, haz una petición POST a la siguiente URL:


Parámetros de consulta

tokenStringAuthenticationAuthentication Token can optionally be sent as a query parameter

Parámetros de cuerpo

ParameterTypeRequired?Default ValueDescription
labelStringYesN/A (required)API label of Variable
nameStringNoSame as labelName of Variable
descriptionStringNo""Description of Variable
device<device_key>YesN/A (required)Key of Device (id or label)
tagsString ArrayNo[]Variable tags
propertiesObjectNo{}Variable properties. Allowed attributes: _icon, _color, minimum_value, maximum_value, isLocationVariable, _position, _scale, _offset
typeStringNorawVariable type. Allowed values raw (default) and synthetic
unitStringNo""Variable unit
syntheticExpressionStringNo""Synthetic Expression of Variable


Atributo properties explicado

_icon: Icon of Variable (FontAwesome)

_color: HEX, RGB and RGBA

minimum_value: Lowest value allowed (Dots posted with a value below the minimum_value will not be saved)

maximum_value: Highest value allowed (Dots posted with a value above the maximum_value will not be saved)

isLocationVariable: Boolean value if the Variable should be taken as location Variable (device location mode: specified)

_scale: All incoming values will be multiplied with this value

_offset: All incoming values will be summed with this value


X-Auth-TokenYesAuthentication Token of account
Content-TypeString (application/json)Content type of body
curl -X POST '' \
 -H 'Content-Type: application/json' \
 -H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73' \
 -d '{
    "label": "second-variable",
    "name": "Second Variable",
    "description": "my second variable",
    "device": "~first-device",
    "tags": ["blue", "yellow"],
    "properties": {},
    "icon": "pencil",
    "unit": "meters"   


Devuelve un objeto Variable con la Variable solicitada.

    "createdAt": "2019-12-18T14:38:38.354415Z",
    "syntheticExpression": "",
    "description": "my second variable",
    "device": {
        "id": "6e309da44fc8455a9cceb5aa",
        "label": "first-device",
        "name": "First Device",
        "url": ""
    "icon": "pencil",
    "id": "5dfa39ee1a9ca53020c69391",
    "label": "var0",
    "lastActivity": null,
    "lastValue": {},
    "name": "var0",
    "properties": {},
    "tags": ["blue", "yellow"],
    "type": "raw",
    "unit": "meters",
    "url": "",
    "valuesUrl": ""
    "code": 400001,
    "message": "Validation Error.",
    "detail": {
    "code": 401001,
    "message": "Authentication credentials were not provided.",
    "detail": "Authentication credentials were not provided."