Navbar
Curl JavaScript Node.JS Python Ruby Go

Domotz Public API v0.6.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.

The Domotz Public API.

Get your API Key and Base URL from the Domotz Portal or contact us.

The Domotz Public API uses standard HTTP response codes, authentication, and verbs. JSON format is used in responses and accepted for request bodies. All date-time formats are expressed as yyyy-mm-ddThh:mm:ss. Date-time must be expressed in UTC. Specification of different TimeZones are not allowed.

Base URLs:

Terms of service Email: API Support

Authentication

agent

listAgents

Code samples

curl -X GET your-domotz-api-endpoint/public-api/v1/agent \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: API_KEY'

var headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

$.ajax({
  url: 'your-domotz-api-endpoint/public-api/v1/agent',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

fetch('your-domotz-api-endpoint/public-api/v1/agent',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'X-Api-Key': 'API_KEY'
}

r = requests.get('your-domotz-api-endpoint/public-api/v1/agent', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'X-Api-Key' => 'API_KEY'
}

result = RestClient.get 'your-domotz-api-endpoint/public-api/v1/agent',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "X-Api-Key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "your-domotz-api-endpoint/public-api/v1/agent", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /agent

Returns the agents list

Curl

curl -X GET your-domotz-api-endpoint/public-api/v1/agent \ -H 'Accept: application/json' \ -H 'X-Api-Key: API_KEY'

Parameters

Parameter In Type Required Description
page_size query integer(int32) false The maximum number of items to return
page_number query integer(int32) false The requested page number, 0-indexed
display_name query string false Consider only agents with display_name containing the string (case insensitive)
team_name query string false Filters by team name (companies only)

Example responses

200 Response

[
  {
    "access_right": {
      "api_enabled": true,
      "granting_user": {
        "name": "user@example.com"
      },
      "status": "OWNED"
    },
    "creation_time": "2019-06-11T09:08:10Z",
    "display_name": "string",
    "id": 0,
    "licence": {
      "activation_time": "2019-06-11T09:08:10Z",
      "bound_mac_address": "string",
      "code": "string",
      "expiration_time": "2019-06-11T09:08:10Z",
      "id": 0
    },
    "status": {
      "last_change": "2019-06-11T09:08:10Z",
      "value": "ONLINE"
    },
    "team": {
      "area": {
        "id": 0
      },
      "id": 0,
      "leader_id": 0,
      "name": "string"
    },
    "timezone": "string",
    "version": {
      "agent": "string",
      "package": "string"
    }
  }
]

Responses

Status Meaning Description Schema
200 OK The agent list Inline

Response Schema

Status Code 200

Name Type Required Description
anonymous [AgentBase] false none
» access_right object false none
»» api_enabled boolean false If false the agent plan doesn't allow for API access: you only can see this agent in the list
»» granting_user object false none
»»» name string(email) false none
»» status string false
  • OWNED: you own this agent
  • PROPOSED: the owner proposed you to access the agent, you can accept or reject the offer
  • GRANTED: you accepted the collaboration request for this agent
  • ASSIGNED: your team leader has given you access to the agent
» creation_time string(date-time) false none
» display_name string true none
» id integer(int32) true none
» licence object false none
»» activation_time string(date-time) false none
»» bound_mac_address string false The MAC address of the primary interface of the device the software agent runs on
»» code string false none
»» expiration_time string(date-time) false none
»» id integer(int32) false none
» status object false none
»» last_change string(date-time) false none
»» value string false none
» team object false The Team and Company Area information, only available for companies
»» area object false none
»»» id integer(int32) false none
»» id integer(int32) false none
»» leader_id integer(int32) false none
»» name string false none
» timezone string false none
» version object false none
»» agent string false none
»» package string false none

Enumerated Values

Property Value
status OWNED
status GRANTED
status PROPOSED
status ASSIGNED
value ONLINE
value OFFLINE

countAgents

Code samples

curl -X HEAD your-domotz-api-endpoint/public-api/v1/agent \
  -H 'X-Api-Key: API_KEY'

var headers = {
  'X-Api-Key':'API_KEY'

};

$.ajax({
  url: 'your-domotz-api-endpoint/public-api/v1/agent',
  method: 'head',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'X-Api-Key':'API_KEY'

};

fetch('your-domotz-api-endpoint/public-api/v1/agent',
{
  method: 'HEAD',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'X-Api-Key': 'API_KEY'
}

r = requests.head('your-domotz-api-endpoint/public-api/v1/agent', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'X-Api-Key' => 'API_KEY'
}

result = RestClient.head 'your-domotz-api-endpoint/public-api/v1/agent',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "X-Api-Key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("HEAD", "your-domotz-api-endpoint/public-api/v1/agent", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

HEAD /agent

Counts the agents

Curl

curl -X HEAD your-domotz-api-endpoint/public-api/v1/agent \ -H 'X-Api-Key: API_KEY'

Parameters

Parameter In Type Required Description
display_name query string false Consider only agents with display_name containing the string (case insensitive)
team_name query string false Filters by team name (companies only)

Responses

Status Meaning Description Schema
204 No Content The number of agents matching the filtering criteria None

Response Headers

Status Header Type Format Description
204 X-Entities-Count integer int32 The number of agents matching the filtering criteria

getAgent

Code samples

curl -X GET your-domotz-api-endpoint/public-api/v1/agent/{agent_id} \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: API_KEY'

var headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

$.ajax({
  url: 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

fetch('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'X-Api-Key': 'API_KEY'
}

r = requests.get('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'X-Api-Key' => 'API_KEY'
}

result = RestClient.get 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "X-Api-Key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "your-domotz-api-endpoint/public-api/v1/agent/{agent_id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /agent/{agent_id}

Returns the details of an agent

Curl

curl -X GET your-domotz-api-endpoint/public-api/v1/agent/{agent_id} \ -H 'Accept: application/json' \ -H 'X-Api-Key: API_KEY'

Parameters

Parameter In Type Required Description
agent_id path integer(int32) true Agent ID

Example responses

200 Response

{
  "access_right": {
    "api_enabled": true,
    "granting_user": {
      "name": "user@example.com"
    },
    "status": "OWNED"
  },
  "creation_time": "2019-06-11T09:08:10Z",
  "display_name": "string",
  "id": 0,
  "licence": {
    "activation_time": "2019-06-11T09:08:10Z",
    "bound_mac_address": "string",
    "code": "string",
    "expiration_time": "2019-06-11T09:08:10Z",
    "id": 0
  },
  "status": {
    "last_change": "2019-06-11T09:08:10Z",
    "value": "ONLINE"
  },
  "team": {
    "area": {
      "id": 0
    },
    "id": 0,
    "leader_id": 0,
    "name": "string"
  },
  "timezone": "string",
  "version": {
    "agent": "string",
    "package": "string"
  },
  "listen_on": "string",
  "location": {
    "latitude": "string",
    "longitude": "string"
  }
}

Responses

Status Meaning Description Schema
200 OK The agent AgentDetail

device

deleteDownDevices

Code samples

curl -X DELETE your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device \
  -H 'X-Api-Key: API_KEY'

var headers = {
  'X-Api-Key':'API_KEY'

};

$.ajax({
  url: 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'X-Api-Key':'API_KEY'

};

fetch('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'X-Api-Key': 'API_KEY'
}

r = requests.delete('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'X-Api-Key' => 'API_KEY'
}

result = RestClient.delete 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "X-Api-Key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /agent/{agent_id}/device

Deletes all the DOWN devices of IP protocol

Curl

curl -X DELETE your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device \ -H 'X-Api-Key: API_KEY'

Parameters

Parameter In Type Required Description
agent_id path integer(int32) true Agent ID

Responses

Status Meaning Description Schema
204 No Content none None

listDevices

Code samples

curl -X GET your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: API_KEY'

var headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

$.ajax({
  url: 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

fetch('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'X-Api-Key': 'API_KEY'
}

r = requests.get('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'X-Api-Key' => 'API_KEY'
}

result = RestClient.get 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "X-Api-Key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /agent/{agent_id}/device

Returns all the devices of an agent

Curl

curl -X GET your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device \ -H 'Accept: application/json' \ -H 'X-Api-Key: API_KEY'

Parameters

Parameter In Type Required Description
agent_id path integer(int32) true Agent ID
show_hidden query boolean false Whether to include hidden devices in the returned list

Example responses

200 Response

[
  {
    "authentication_status": "AUTHENTICATED",
    "details": {
      "room": "string",
      "snmp_read_community": "string",
      "snmp_write_community": "string",
      "zone": "string"
    },
    "display_name": "string",
    "first_seen_on": "2019-06-11T09:08:10Z",
    "id": 0,
    "importance": "VITAL",
    "main_id": 0,
    "protocol": "IP",
    "type": {
      "detected_id": 0,
      "id": 0
    },
    "user_data": {
      "model": "string",
      "name": "string",
      "type": 0,
      "vendor": "string"
    }
  }
]

Responses

Status Meaning Description Schema
200 OK The list of all devices in the Agent's monitored networks Inline

Response Schema

Enumerated Values

Property Value
authentication_status AUTHENTICATED
authentication_status NO_AUTHENTICATION
authentication_status PENDING
authentication_status REQUIRED
authentication_status WRONG_CREDENTIALS
importance VITAL
importance FLOATING
protocol IP
protocol DUMMY
protocol IP_EXTERNAL
status ONLINE
status OFFLINE
status DOWN
status HIDDEN

deleteDevice

Code samples

curl -X DELETE your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id} \
  -H 'X-Api-Key: API_KEY'

var headers = {
  'X-Api-Key':'API_KEY'

};

$.ajax({
  url: 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'X-Api-Key':'API_KEY'

};

fetch('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'X-Api-Key': 'API_KEY'
}

r = requests.delete('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'X-Api-Key' => 'API_KEY'
}

result = RestClient.delete 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "X-Api-Key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /agent/{agent_id}/device/{device_id}

Deletes a device, whether ONLINE, OFFLINE or DOWN . If a device is deleted while online, it may reappear when rediscovered automatically

Curl

curl -X DELETE your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id} \ -H 'X-Api-Key: API_KEY'

Parameters

Parameter In Type Required Description
agent_id path integer(int32) true Agent ID
device_id path integer(int32) true Device ID

Responses

Status Meaning Description Schema
204 No Content none None

getDevice

Code samples

curl -X GET your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id} \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: API_KEY'

var headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

$.ajax({
  url: 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

fetch('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'X-Api-Key': 'API_KEY'
}

r = requests.get('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'X-Api-Key' => 'API_KEY'
}

result = RestClient.get 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "X-Api-Key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /agent/{agent_id}/device/{device_id}

Returns the details of a device

Curl

curl -X GET your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id} \ -H 'Accept: application/json' \ -H 'X-Api-Key: API_KEY'

Parameters

Parameter In Type Required Description
agent_id path integer(int32) true Agent ID
device_id path integer(int32) true Device ID

Example responses

200 Response

{
  "authentication_status": "AUTHENTICATED",
  "details": {
    "room": "string",
    "snmp_read_community": "string",
    "snmp_write_community": "string",
    "zone": "string"
  },
  "display_name": "string",
  "first_seen_on": "2019-06-11T09:08:10Z",
  "id": 0,
  "importance": "VITAL",
  "main_id": 0,
  "protocol": "IP",
  "type": {
    "detected_id": 0,
    "id": 0
  },
  "user_data": {
    "model": "string",
    "name": "string",
    "type": 0,
    "vendor": "string"
  }
}

Responses

Status Meaning Description Schema
200 OK An object containing the device details Inline

Response Schema

Enumerated Values

Property Value
authentication_status AUTHENTICATED
authentication_status NO_AUTHENTICATION
authentication_status PENDING
authentication_status REQUIRED
authentication_status WRONG_CREDENTIALS
importance VITAL
importance FLOATING
protocol IP
protocol DUMMY
protocol IP_EXTERNAL
status ONLINE
status OFFLINE
status DOWN
status HIDDEN

getDevicePowerActions

Code samples

curl -X GET your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/action/power \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: API_KEY'

var headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

$.ajax({
  url: 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/action/power',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

fetch('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/action/power',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'X-Api-Key': 'API_KEY'
}

r = requests.get('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/action/power', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'X-Api-Key' => 'API_KEY'
}

result = RestClient.get 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/action/power',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "X-Api-Key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/action/power", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /agent/{agent_id}/device/{device_id}/action/power

Returns the power management actions available on the device at the current moment. See DevicePowerAction schema for further details.

Curl

curl -X GET your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/action/power \ -H 'Accept: application/json' \ -H 'X-Api-Key: API_KEY'

Parameters

Parameter In Type Required Description
agent_id path integer(int32) true Agent ID
device_id path integer(int32) true Device ID

Example responses

200 Response

{
  "cycle": true,
  "off": true,
  "on": true,
  "software_reboot": true
}

Responses

Status Meaning Description Schema
200 OK Returns a JSON object indicating the current availability of each power action on the device DevicePowerAction

powerActionOnDevice

Code samples

curl -X POST your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/action/power/{field} \
  -H 'X-Api-Key: API_KEY'

var headers = {
  'X-Api-Key':'API_KEY'

};

$.ajax({
  url: 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/action/power/{field}',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'X-Api-Key':'API_KEY'

};

fetch('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/action/power/{field}',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'X-Api-Key': 'API_KEY'
}

r = requests.post('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/action/power/{field}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'X-Api-Key' => 'API_KEY'
}

result = RestClient.post 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/action/power/{field}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "X-Api-Key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/action/power/{field}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /agent/{agent_id}/device/{device_id}/action/power/{field}

Performs the action on the device, according to the specified { field } value. The availability of such operations can be determined with a call to getDevicePowerActions operation

Curl

curl -X POST your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/action/power/{field} \ -H 'X-Api-Key: API_KEY'

Parameters

Parameter In Type Required Description
agent_id path integer(int32) true Agent ID
device_id path integer(int32) true Device ID
field path string true Specifies the power action to perform

Enumerated Values

Parameter Value
field on
field off
field software-reboot
field cycle

Responses

Status Meaning Description Schema
204 No Content none None

setCredentials

Code samples

curl -X PUT your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/credentials \
  -H 'Content-Type: application/json' \
  -H 'X-Api-Key: API_KEY'

var headers = {
  'Content-Type':'application/json',
  'X-Api-Key':'API_KEY'

};

$.ajax({
  url: 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/credentials',
  method: 'put',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "password": "string",
  "username": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'X-Api-Key':'API_KEY'

};

fetch('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/credentials',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'X-Api-Key': 'API_KEY'
}

r = requests.put('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/credentials', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'X-Api-Key' => 'API_KEY'
}

result = RestClient.put 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/credentials',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "X-Api-Key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PUT", "your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/credentials", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PUT /agent/{agent_id}/device/{device_id}/credentials

Sets the device credentials to perform extended discovery. This operation will affect the authentication_status of the device

Body parameter

{
  "password": "string",
  "username": "string"
}

Curl

curl -X PUT your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/credentials \ -H 'Content-Type: application/json' \ -H 'X-Api-Key: API_KEY'

Parameters

Parameter In Type Required Description
agent_id path integer(int32) true Agent ID
device_id path integer(int32) true Device ID
body body DeviceCredentials true device credentials payload

Responses

Status Meaning Description Schema
204 No Content none None

setSnmpCommunity

Code samples

curl -X PUT your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/snmp-community \
  -H 'Content-Type: application/json' \
  -H 'X-Api-Key: API_KEY'

var headers = {
  'Content-Type':'application/json',
  'X-Api-Key':'API_KEY'

};

$.ajax({
  url: 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/snmp-community',
  method: 'put',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "read": "string",
  "write": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'X-Api-Key':'API_KEY'

};

fetch('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/snmp-community',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'X-Api-Key': 'API_KEY'
}

r = requests.put('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/snmp-community', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'X-Api-Key' => 'API_KEY'
}

result = RestClient.put 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/snmp-community',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "X-Api-Key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PUT", "your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/snmp-community", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PUT /agent/{agent_id}/device/{device_id}/snmp-community

Saves a snmp community (read, optionally write) on device

Body parameter

{
  "read": "string",
  "write": "string"
}

Curl

curl -X PUT your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/snmp-community \ -H 'Content-Type: application/json' \ -H 'X-Api-Key: API_KEY'

Parameters

Parameter In Type Required Description
agent_id path integer(int32) true Agent ID
device_id path integer(int32) true Device ID
body body DeviceSnmpCommunity true The value that the snmp community entries will change to

Responses

Status Meaning Description Schema
204 No Content none None

hideDevice

Code samples

curl -X DELETE your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/visibility \
  -H 'X-Api-Key: API_KEY'

var headers = {
  'X-Api-Key':'API_KEY'

};

$.ajax({
  url: 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/visibility',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'X-Api-Key':'API_KEY'

};

fetch('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/visibility',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'X-Api-Key': 'API_KEY'
}

r = requests.delete('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/visibility', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'X-Api-Key' => 'API_KEY'
}

result = RestClient.delete 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/visibility',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "X-Api-Key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/visibility", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /agent/{agent_id}/device/{device_id}/visibility

Hides a device (available only on DOWN devices)

Curl

curl -X DELETE your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/visibility \ -H 'X-Api-Key: API_KEY'

Parameters

Parameter In Type Required Description
agent_id path integer(int32) true Agent ID
device_id path integer(int32) true Device ID

Responses

Status Meaning Description Schema
204 No Content none None

editDevice

Code samples

curl -X PUT your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/{field} \
  -H 'Content-Type: application/json' \
  -H 'X-Api-Key: API_KEY'

var headers = {
  'Content-Type':'application/json',
  'X-Api-Key':'API_KEY'

};

$.ajax({
  url: 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/{field}',
  method: 'put',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = 'string';
const headers = {
  'Content-Type':'application/json',
  'X-Api-Key':'API_KEY'

};

fetch('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/{field}',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'X-Api-Key': 'API_KEY'
}

r = requests.put('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/{field}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'X-Api-Key' => 'API_KEY'
}

result = RestClient.put 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/{field}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "X-Api-Key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PUT", "your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/{field}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PUT /agent/{agent_id}/device/{device_id}/{field}

Changes a field of the device or one of its details

Body parameter

"string"

Curl

curl -X PUT your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/{field} \ -H 'Content-Type: application/json' \ -H 'X-Api-Key: API_KEY'

Parameters

Parameter In Type Required Description
agent_id path integer(int32) true Agent ID
device_id path integer(int32) true Device ID
field path string true The field to update - for the type and valid values see the description of the corresponding output parameter
body body string true The value that the field will change to

Enumerated Values

Parameter Value
field user_data/vendor
field details/zone
field importance
field details/room
field user_data/name
field user_data/type
field user_data/model

Responses

Status Meaning Description Schema
204 No Content none None

metrics

getAgentRTDStats

Code samples

curl -X GET your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/rtd \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: API_KEY'

var headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

$.ajax({
  url: 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/rtd',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

fetch('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/rtd',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'X-Api-Key': 'API_KEY'
}

r = requests.get('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/rtd', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'X-Api-Key' => 'API_KEY'
}

result = RestClient.get 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/rtd',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "X-Api-Key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/rtd", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /agent/{agent_id}/device/rtd

Returns the Round Trip Delay statistics for all devices monitored by the agent. The aggregate values of avg_min, avg_max, avg_median help to understand the baseline response time of a device in a weekly time frame, while latest_median helps detecting a possible deviation from the baseline

Curl

curl -X GET your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/rtd \ -H 'Accept: application/json' \ -H 'X-Api-Key: API_KEY'

Parameters

Parameter In Type Required Description
agent_id path integer(int32) true Agent ID

Example responses

200 Response

[
  {
    "avg_max": "string",
    "avg_median": "string",
    "avg_min": "string",
    "device_id": 0,
    "latest_lost_packet_count": 0,
    "latest_median": "string",
    "latest_sent_packet_count": 0,
    "timestamp": "2019-06-11T09:08:10Z"
  }
]

Responses

Status Meaning Description Schema
200 OK Devices RTD Statistics Inline

Response Schema

Status Code 200

Name Type Required Description
anonymous [DeviceRTDStatistics] false none
» avg_max string false none
» avg_median string false none
» avg_min string false none
» device_id integer(int32) true none
» latest_lost_packet_count integer(int32) false The number of lost packets of the latest collection sample
» latest_median string false The median value of the latest collection sample
» latest_sent_packet_count integer(int32) false The number of sent packets of the latest collection sample
» timestamp string(date-time) true The timestamp of the latest update

getDeviceStatusHistory

Code samples

curl -X GET your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/history/network/event \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: API_KEY'

var headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

$.ajax({
  url: 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/history/network/event',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

fetch('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/history/network/event',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'X-Api-Key': 'API_KEY'
}

r = requests.get('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/history/network/event', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'X-Api-Key' => 'API_KEY'
}

result = RestClient.get 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/history/network/event',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "X-Api-Key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/history/network/event", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /agent/{agent_id}/device/{device_id}/history/network/event

Returns the time series of the state changes of the device

Curl

curl -X GET your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/history/network/event \ -H 'Accept: application/json' \ -H 'X-Api-Key: API_KEY'

Parameters

Parameter In Type Required Description
agent_id path integer(int32) true Agent ID
device_id path integer(int32) true Device ID
from query string(date-time) false The start time of the time series. Default value is one week
to query string(date-time) false The end time of the time series. Default value is now

Example responses

200 Response

[
  {
    "details": {
      "new_ip": [
        "string"
      ],
      "old_ip": [
        "string"
      ]
    },
    "timestamp": "2019-06-11T09:08:10Z",
    "type": "IP_CHANGE"
  }
]

Responses

Status Meaning Description Schema
200 OK A time series Inline

Response Schema

Status Code 200

Name Type Required Description
anonymous [DeviceHistory] false none
» details object false none
»» new_ip [string] false The new IP addresses
»» old_ip [string] false The old IP addresses
» timestamp string(date-time) true The time the sample was reported to Domotz
» type string true The device event type

Enumerated Values

Property Value
type IP_CHANGE
type CREATED
type UP
type DOWN

getDeviceRTDHistory

Code samples

curl -X GET your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/history/rtd \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: API_KEY'

var headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

$.ajax({
  url: 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/history/rtd',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

fetch('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/history/rtd',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'X-Api-Key': 'API_KEY'
}

r = requests.get('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/history/rtd', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'X-Api-Key' => 'API_KEY'
}

result = RestClient.get 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/history/rtd',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "X-Api-Key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/history/rtd", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /agent/{agent_id}/device/{device_id}/history/rtd

Returns the Round Trip Delay history for the device. Each item represents the statistical aggregate of a set of Round Trip Delay measurements

Curl

curl -X GET your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/history/rtd \ -H 'Accept: application/json' \ -H 'X-Api-Key: API_KEY'

Parameters

Parameter In Type Required Description
agent_id path integer(int32) true Agent ID
device_id path integer(int32) true Device ID
from query string(date-time) false The start time of the time series. Default value is one week
to query string(date-time) false The end time of the time series. Default value is now

Example responses

200 Response

[
  {
    "lost_packet_count": 0,
    "max": "string",
    "median": "string",
    "min": "string",
    "sent_packet_count": 0,
    "timestamp": "2019-06-11T09:08:10Z"
  }
]

Responses

Status Meaning Description Schema
200 OK Device RTD History Inline

Response Schema

Status Code 200

Name Type Required Description
anonymous [DeviceRTDHistorySample] false none
» lost_packet_count integer(int32) false none
» max string false none
» median string false none
» min string false none
» sent_packet_count integer(int32) false none
» timestamp string(date-time) true The time the sample was reported to Domotz

getAgentStatusHistory

Code samples

curl -X GET your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/history/network/event \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: API_KEY'

var headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

$.ajax({
  url: 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/history/network/event',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

fetch('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/history/network/event',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'X-Api-Key': 'API_KEY'
}

r = requests.get('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/history/network/event', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'X-Api-Key' => 'API_KEY'
}

result = RestClient.get 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/history/network/event',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "X-Api-Key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/history/network/event", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /agent/{agent_id}/history/network/event

Returns the time series of the state changes of the agent

Curl

curl -X GET your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/history/network/event \ -H 'Accept: application/json' \ -H 'X-Api-Key: API_KEY'

Parameters

Parameter In Type Required Description
agent_id path integer(int32) true Agent ID
from query string(date-time) false The start time of the time series. Default value is one week
to query string(date-time) false The end time of the time series. Default value is now

Example responses

200 Response

[
  {
    "timestamp": "2019-06-11T09:08:10Z",
    "type": "CONNECTION_RECOVERED"
  }
]

Responses

Status Meaning Description Schema
200 OK A time series Inline

Response Schema

Status Code 200

Name Type Required Description
anonymous [AgentHistory] false none
» timestamp string(date-time) true The time the sample was reported to Domotz
» type string true The agent event type

Enumerated Values

Property Value
type CONNECTION_RECOVERED
type CONNECTION_LOST
type UP
type DOWN

getSpeedTestHistory

Code samples

curl -X GET your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/history/network/speed \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: API_KEY'

var headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

$.ajax({
  url: 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/history/network/speed',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

fetch('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/history/network/speed',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'X-Api-Key': 'API_KEY'
}

r = requests.get('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/history/network/speed', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'X-Api-Key' => 'API_KEY'
}

result = RestClient.get 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/history/network/speed',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "X-Api-Key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/history/network/speed", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /agent/{agent_id}/history/network/speed

Returns the time series of the Internet Speed measurements taken from the agent, both in download and in upload.

Curl

curl -X GET your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/history/network/speed \ -H 'Accept: application/json' \ -H 'X-Api-Key: API_KEY'

Parameters

Parameter In Type Required Description
agent_id path integer(int32) true Agent ID
from query string(date-time) false The start time of the time series. Default value is one week
to query string(date-time) false The end time of the time series. Default value is now

Example responses

200 Response

[
  {
    "timestamp": "2019-06-11T09:08:10Z",
    "values": [
      0
    ]
  }
]

Responses

Status Meaning Description Schema
200 OK A time series Inline

Response Schema

Status Code 200

Name Type Required Description
anonymous [NetworkSpeedSample] false [A Network Speed Sample is the result of the measurement of the Internet download and upload speed, in bits per second, taken by the Agent]
» timestamp string(date-time) false The time the sample was reported to Domotz
» values [integer] false A pair of values: the download and upload speed, in Bit Per Seconds (bps), as measured by the Agent

actions

connectToDevice

Code samples

curl -X POST your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/connection \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: API_KEY'

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

$.ajax({
  url: 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/connection',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "allowed_ip": "string",
  "port": 0,
  "protocol": "http"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

fetch('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/connection',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'X-Api-Key': 'API_KEY'
}

r = requests.post('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/connection', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'X-Api-Key' => 'API_KEY'
}

result = RestClient.post 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/connection',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "X-Api-Key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/connection", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /agent/{agent_id}/device/{device_id}/connection

Establishes a direct secure connection to the device

Body parameter

{
  "allowed_ip": "string",
  "port": 0,
  "protocol": "http"
}

Curl

curl -X POST your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/connection \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'X-Api-Key: API_KEY'

Parameters

Parameter In Type Required Description
agent_id path integer(int32) true Agent ID
device_id path integer(int32) true Device ID
body body DeviceConnection true none

Example responses

201 Response

{
  "allowed_ip": "string",
  "expiration": "2019-06-11T09:08:10Z",
  "id": 0,
  "link": "string",
  "port": 0,
  "protocol": "http"
}

Responses

Status Meaning Description Schema
201 Created none ConnectionSession

multimedia

onvifSnapshot

Code samples

curl -X GET your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/multimedia/camera/snapshot \
  -H 'Accept: image/*' \
  -H 'X-Api-Key: API_KEY'

var headers = {
  'Accept':'image/*',
  'X-Api-Key':'API_KEY'

};

$.ajax({
  url: 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/multimedia/camera/snapshot',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'image/*',
  'X-Api-Key':'API_KEY'

};

fetch('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/multimedia/camera/snapshot',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'image/*',
  'X-Api-Key': 'API_KEY'
}

r = requests.get('your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/multimedia/camera/snapshot', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'image/*',
  'X-Api-Key' => 'API_KEY'
}

result = RestClient.get 'your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/multimedia/camera/snapshot',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"image/*"},
        "X-Api-Key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/multimedia/camera/snapshot", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /agent/{agent_id}/device/{device_id}/multimedia/camera/snapshot

Take a snapshot of the camera.

Curl

curl -X GET your-domotz-api-endpoint/public-api/v1/agent/{agent_id}/device/{device_id}/multimedia/camera/snapshot \ -H 'Accept: image/*' \ -H 'X-Api-Key: API_KEY'

Parameters

Parameter In Type Required Description
agent_id path integer(int32) true Agent ID
device_id path integer(int32) true Device ID

Example responses

200 Response

Responses

Status Meaning Description Schema
200 OK A binary image string

alert profiles

getAlertProfiles

Code samples

curl -X GET your-domotz-api-endpoint/public-api/v1/user/{user_id}/alert-profile \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: API_KEY'

var headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

$.ajax({
  url: 'your-domotz-api-endpoint/public-api/v1/user/{user_id}/alert-profile',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

fetch('your-domotz-api-endpoint/public-api/v1/user/{user_id}/alert-profile',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'X-Api-Key': 'API_KEY'
}

r = requests.get('your-domotz-api-endpoint/public-api/v1/user/{user_id}/alert-profile', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'X-Api-Key' => 'API_KEY'
}

result = RestClient.get 'your-domotz-api-endpoint/public-api/v1/user/{user_id}/alert-profile',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "X-Api-Key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "your-domotz-api-endpoint/public-api/v1/user/{user_id}/alert-profile", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /user/{user_id}/alert-profile

Returns the list of configured alert profiles. You can configure alert profiles on the Domotz Portal. Alert profiles define the association between a list of events and a notification channel (email, webhook or slack)

Curl

curl -X GET your-domotz-api-endpoint/public-api/v1/user/{user_id}/alert-profile \ -H 'Accept: application/json' \ -H 'X-Api-Key: API_KEY'

Parameters

Parameter In Type Required Description
user_id path integer(int32) true User ID

Example responses

200 Response

[
  {
    "description": "string",
    "events": [
      "device_status"
    ],
    "id": 0,
    "is_enabled": true,
    "name": "string",
    "tag": "string"
  }
]

Responses

Status Meaning Description Schema
200 OK The list of configured alert profiles Inline

Response Schema

Status Code 200

Name Type Required Description
anonymous [AlertProfile] false none
» description string false The description of the alert profile
» events [string] false The list of events associated to the profile
» id integer(int32) true The id of the event profile
» is_enabled boolean false true if the event profile is enabled, false otherwise
» name string false The symbolic name associated to the profile
» tag string false A label associated to the profile

getAgentAlertProfile

Code samples

curl -X GET your-domotz-api-endpoint/public-api/v1/alert-profile/binding/agent/{agent_id} \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: API_KEY'

var headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

$.ajax({
  url: 'your-domotz-api-endpoint/public-api/v1/alert-profile/binding/agent/{agent_id}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

fetch('your-domotz-api-endpoint/public-api/v1/alert-profile/binding/agent/{agent_id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'X-Api-Key': 'API_KEY'
}

r = requests.get('your-domotz-api-endpoint/public-api/v1/alert-profile/binding/agent/{agent_id}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'X-Api-Key' => 'API_KEY'
}

result = RestClient.get 'your-domotz-api-endpoint/public-api/v1/alert-profile/binding/agent/{agent_id}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "X-Api-Key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "your-domotz-api-endpoint/public-api/v1/alert-profile/binding/agent/{agent_id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /alert-profile/binding/agent/{agent_id}

Get the alert profile bindings of an agent

Curl

curl -X GET your-domotz-api-endpoint/public-api/v1/alert-profile/binding/agent/{agent_id} \ -H 'Accept: application/json' \ -H 'X-Api-Key: API_KEY'

Parameters

Parameter In Type Required Description
agent_id path integer(int32) true Agent ID
alert_profile_id path integer(int32) true Profile ID

Example responses

200 Response

[
  {
    "alert_profile_id": 0
  }
]

Responses

Status Meaning Description Schema
200 OK The alert profile bindings of an agent Inline

Response Schema

Status Code 200

Name Type Required Description
anonymous [AlertProfileAgentBinding] false none
» alert_profile_id integer(int32) true The id of the alert profile

getDevicesAlertProfile

Code samples

curl -X GET your-domotz-api-endpoint/public-api/v1/alert-profile/binding/agent/{agent_id}/device \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: API_KEY'

var headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

$.ajax({
  url: 'your-domotz-api-endpoint/public-api/v1/alert-profile/binding/agent/{agent_id}/device',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

fetch('your-domotz-api-endpoint/public-api/v1/alert-profile/binding/agent/{agent_id}/device',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'X-Api-Key': 'API_KEY'
}

r = requests.get('your-domotz-api-endpoint/public-api/v1/alert-profile/binding/agent/{agent_id}/device', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'X-Api-Key' => 'API_KEY'
}

result = RestClient.get 'your-domotz-api-endpoint/public-api/v1/alert-profile/binding/agent/{agent_id}/device',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "X-Api-Key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "your-domotz-api-endpoint/public-api/v1/alert-profile/binding/agent/{agent_id}/device", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /alert-profile/binding/agent/{agent_id}/device

Get the alert profile bindings of the devices of an agent

Curl

curl -X GET your-domotz-api-endpoint/public-api/v1/alert-profile/binding/agent/{agent_id}/device \ -H 'Accept: application/json' \ -H 'X-Api-Key: API_KEY'

Parameters

Parameter In Type Required Description
agent_id path integer(int32) true Agent ID
alert_profile_id path integer(int32) true Profile ID

Example responses

200 Response

[
  {
    "alert_profile_id": 0,
    "device_id": 0
  }
]

Responses

Status Meaning Description Schema
200 OK The alert profile bindings for all devices of the agent Inline

Response Schema

Status Code 200

Name Type Required Description
anonymous [AlertProfileDeviceBinding] false none
» alert_profile_id integer(int32) true The id of the alert profile
» device_id integer(int32) true none

unbindAlertProfileFromAgent

Code samples

curl -X DELETE your-domotz-api-endpoint/public-api/v1/alert-profile/{alert_profile_id}/binding/agent/{agent_id} \
  -H 'X-Api-Key: API_KEY'

var headers = {
  'X-Api-Key':'API_KEY'

};

$.ajax({
  url: 'your-domotz-api-endpoint/public-api/v1/alert-profile/{alert_profile_id}/binding/agent/{agent_id}',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'X-Api-Key':'API_KEY'

};

fetch('your-domotz-api-endpoint/public-api/v1/alert-profile/{alert_profile_id}/binding/agent/{agent_id}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'X-Api-Key': 'API_KEY'
}

r = requests.delete('your-domotz-api-endpoint/public-api/v1/alert-profile/{alert_profile_id}/binding/agent/{agent_id}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'X-Api-Key' => 'API_KEY'
}

result = RestClient.delete 'your-domotz-api-endpoint/public-api/v1/alert-profile/{alert_profile_id}/binding/agent/{agent_id}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "X-Api-Key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "your-domotz-api-endpoint/public-api/v1/alert-profile/{alert_profile_id}/binding/agent/{agent_id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /alert-profile/{alert_profile_id}/binding/agent/{agent_id}

Unbind an alert profile from an agent.

Curl

curl -X DELETE your-domotz-api-endpoint/public-api/v1/alert-profile/{alert_profile_id}/binding/agent/{agent_id} \ -H 'X-Api-Key: API_KEY'

Parameters

Parameter In Type Required Description
agent_id path integer(int32) true Agent ID
alert_profile_id path integer(int32) true Profile ID

Responses

Status Meaning Description Schema
204 No Content none None

bindAlertProfileToAgent

Code samples

curl -X POST your-domotz-api-endpoint/public-api/v1/alert-profile/{alert_profile_id}/binding/agent/{agent_id} \
  -H 'X-Api-Key: API_KEY'

var headers = {
  'X-Api-Key':'API_KEY'

};

$.ajax({
  url: 'your-domotz-api-endpoint/public-api/v1/alert-profile/{alert_profile_id}/binding/agent/{agent_id}',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'X-Api-Key':'API_KEY'

};

fetch('your-domotz-api-endpoint/public-api/v1/alert-profile/{alert_profile_id}/binding/agent/{agent_id}',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'X-Api-Key': 'API_KEY'
}

r = requests.post('your-domotz-api-endpoint/public-api/v1/alert-profile/{alert_profile_id}/binding/agent/{agent_id}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'X-Api-Key' => 'API_KEY'
}

result = RestClient.post 'your-domotz-api-endpoint/public-api/v1/alert-profile/{alert_profile_id}/binding/agent/{agent_id}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "X-Api-Key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "your-domotz-api-endpoint/public-api/v1/alert-profile/{alert_profile_id}/binding/agent/{agent_id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /alert-profile/{alert_profile_id}/binding/agent/{agent_id}

Bind an alert profile to an agent. After binding, a webhook will be sent to the configured service when one of the events associated to the profile occurs. You can configure the profile and the webhook endpoint on the Domotz Portal

Curl

curl -X POST your-domotz-api-endpoint/public-api/v1/alert-profile/{alert_profile_id}/binding/agent/{agent_id} \ -H 'X-Api-Key: API_KEY'

Parameters

Parameter In Type Required Description
agent_id path integer(int32) true Agent ID
alert_profile_id path integer(int32) true Profile ID

Responses

Status Meaning Description Schema
204 No Content none None

Webhook Events

Event Name Method Schema Expected Reply
agent_device_discovery POST DeviceDiscoveryEvent 201
agent_security_issue POST AgentSecurityIssueEvent 201
agent_speed_test POST AgentSpeedTestEvent 201
agent_status POST AgentStatusEvent 201

unbindAlertProfileFromDevice

Code samples

curl -X DELETE your-domotz-api-endpoint/public-api/v1/alert-profile/{alert_profile_id}/binding/agent/{agent_id}/device/{device_id} \
  -H 'X-Api-Key: API_KEY'

var headers = {
  'X-Api-Key':'API_KEY'

};

$.ajax({
  url: 'your-domotz-api-endpoint/public-api/v1/alert-profile/{alert_profile_id}/binding/agent/{agent_id}/device/{device_id}',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'X-Api-Key':'API_KEY'

};

fetch('your-domotz-api-endpoint/public-api/v1/alert-profile/{alert_profile_id}/binding/agent/{agent_id}/device/{device_id}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'X-Api-Key': 'API_KEY'
}

r = requests.delete('your-domotz-api-endpoint/public-api/v1/alert-profile/{alert_profile_id}/binding/agent/{agent_id}/device/{device_id}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'X-Api-Key' => 'API_KEY'
}

result = RestClient.delete 'your-domotz-api-endpoint/public-api/v1/alert-profile/{alert_profile_id}/binding/agent/{agent_id}/device/{device_id}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "X-Api-Key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "your-domotz-api-endpoint/public-api/v1/alert-profile/{alert_profile_id}/binding/agent/{agent_id}/device/{device_id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /alert-profile/{alert_profile_id}/binding/agent/{agent_id}/device/{device_id}

Unbind an alert profile from a device

Curl

curl -X DELETE your-domotz-api-endpoint/public-api/v1/alert-profile/{alert_profile_id}/binding/agent/{agent_id}/device/{device_id} \ -H 'X-Api-Key: API_KEY'

Parameters

Parameter In Type Required Description
agent_id path integer(int32) true Agent ID
alert_profile_id path integer(int32) true Profile ID
device_id path integer(int32) true Device ID

Responses

Status Meaning Description Schema
204 No Content none None

bindAlertProfileToDevice

Code samples

curl -X POST your-domotz-api-endpoint/public-api/v1/alert-profile/{alert_profile_id}/binding/agent/{agent_id}/device/{device_id} \
  -H 'X-Api-Key: API_KEY'

var headers = {
  'X-Api-Key':'API_KEY'

};

$.ajax({
  url: 'your-domotz-api-endpoint/public-api/v1/alert-profile/{alert_profile_id}/binding/agent/{agent_id}/device/{device_id}',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'X-Api-Key':'API_KEY'

};

fetch('your-domotz-api-endpoint/public-api/v1/alert-profile/{alert_profile_id}/binding/agent/{agent_id}/device/{device_id}',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'X-Api-Key': 'API_KEY'
}

r = requests.post('your-domotz-api-endpoint/public-api/v1/alert-profile/{alert_profile_id}/binding/agent/{agent_id}/device/{device_id}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'X-Api-Key' => 'API_KEY'
}

result = RestClient.post 'your-domotz-api-endpoint/public-api/v1/alert-profile/{alert_profile_id}/binding/agent/{agent_id}/device/{device_id}',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "X-Api-Key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "your-domotz-api-endpoint/public-api/v1/alert-profile/{alert_profile_id}/binding/agent/{agent_id}/device/{device_id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /alert-profile/{alert_profile_id}/binding/agent/{agent_id}/device/{device_id}

Bind an alert profile to a device. After binding, a webhook will be sent to the configured service when one of the events associated to the profile occurs. You can configure the profile and the webhook endpoint on the Domotz Portal

Curl

curl -X POST your-domotz-api-endpoint/public-api/v1/alert-profile/{alert_profile_id}/binding/agent/{agent_id}/device/{device_id} \ -H 'X-Api-Key: API_KEY'

Parameters

Parameter In Type Required Description
agent_id path integer(int32) true Agent ID
alert_profile_id path integer(int32) true Profile ID
device_id path integer(int32) true Device ID

Responses

Status Meaning Description Schema
204 No Content none None

Webhook Events

Event Name Method Schema Expected Reply
device_heartbeat_lost POST DeviceHeartbeatLostEvent 201
device_ip_change POST DeviceIPChangeEvent 201
device_rtd POST DeviceTCPEvent 201
device_snmp POST DeviceSNMPEvent 201
device_status POST DeviceStatusChangeEvent 201
device_tcp POST DeviceTCPEvent 201

meta

apiUsageInfo

Code samples

curl -X GET your-domotz-api-endpoint/public-api/v1/meta/usage \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: API_KEY'

var headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

$.ajax({
  url: 'your-domotz-api-endpoint/public-api/v1/meta/usage',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

fetch('your-domotz-api-endpoint/public-api/v1/meta/usage',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'X-Api-Key': 'API_KEY'
}

r = requests.get('your-domotz-api-endpoint/public-api/v1/meta/usage', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'X-Api-Key' => 'API_KEY'
}

result = RestClient.get 'your-domotz-api-endpoint/public-api/v1/meta/usage',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "X-Api-Key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "your-domotz-api-endpoint/public-api/v1/meta/usage", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /meta/usage

Retrieves information about API usage and limits

Example responses

200 Response

{
  "by_ip": [
    {
      "count": 0,
      "name": "string"
    }
  ],
  "by_key": [
    {
      "count": 0,
      "id": 0,
      "name": "string"
    }
  ],
  "by_resource": [
    {
      "count": 0,
      "name": "string"
    }
  ],
  "concurrent_allowed": 0,
  "daily_limit": 0,
  "daily_usage": 0
}

Responses

Status Meaning Description Schema
200 OK A data structure containing information about current API usage and usage limits APIUsageInformation

assets

listDeviceBaseTypes

Code samples

curl -X GET your-domotz-api-endpoint/public-api/v1/type/device/base \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: API_KEY'

var headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

$.ajax({
  url: 'your-domotz-api-endpoint/public-api/v1/type/device/base',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

fetch('your-domotz-api-endpoint/public-api/v1/type/device/base',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'X-Api-Key': 'API_KEY'
}

r = requests.get('your-domotz-api-endpoint/public-api/v1/type/device/base', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'X-Api-Key' => 'API_KEY'
}

result = RestClient.get 'your-domotz-api-endpoint/public-api/v1/type/device/base',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "X-Api-Key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "your-domotz-api-endpoint/public-api/v1/type/device/base", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /type/device/base

Returns the device types list

Example responses

200 Response

[
  {
    "id": 0,
    "identifier": "string",
    "label": "string",
    "vital": true
  }
]

Responses

Status Meaning Description Schema
200 OK The types list Inline

Response Schema

Status Code 200

Name Type Required Description
anonymous [DeviceBaseType] false [A device type, either set by the user or as identified by the Domotz system]
» id integer(int32) false An unique identifier of the type, referred in the Device entity
» identifier string false The name of the type
» label string false A human-readable short description of the type
» vital boolean false Whether a device of this type will be marked as VITAL as soon as recognised

listDeviceDetectedTypes

Code samples

curl -X GET your-domotz-api-endpoint/public-api/v1/type/device/detected \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: API_KEY'

var headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

$.ajax({
  url: 'your-domotz-api-endpoint/public-api/v1/type/device/detected',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

fetch('your-domotz-api-endpoint/public-api/v1/type/device/detected',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'X-Api-Key': 'API_KEY'
}

r = requests.get('your-domotz-api-endpoint/public-api/v1/type/device/detected', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'X-Api-Key' => 'API_KEY'
}

result = RestClient.get 'your-domotz-api-endpoint/public-api/v1/type/device/detected',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "X-Api-Key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "your-domotz-api-endpoint/public-api/v1/type/device/detected", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /type/device/detected

Returns the detected device types list

Example responses

200 Response

[
  {
    "capabilities": [
      "string"
    ],
    "id": 0,
    "identifier": "string",
    "label": "string",
    "type_id": 0
  }
]

Responses

Status Meaning Description Schema
200 OK The types list Inline

Response Schema

Status Code 200

Name Type Required Description
anonymous [DetectedDeviceType] false [A device type, detected by the Domotz device identification feature]
» capabilities [string] false The features of the device
» id integer(int32) false An unique identifier of the type, referred in the Device entity
» identifier string false The name of the type
» label string false A human-readable short description of the type
» type_id integer(int32) false The corresponding device type

user

getUser

Code samples

curl -X GET your-domotz-api-endpoint/public-api/v1/user \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: API_KEY'

var headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

$.ajax({
  url: 'your-domotz-api-endpoint/public-api/v1/user',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'X-Api-Key':'API_KEY'

};

fetch('your-domotz-api-endpoint/public-api/v1/user',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'X-Api-Key': 'API_KEY'
}

r = requests.get('your-domotz-api-endpoint/public-api/v1/user', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'X-Api-Key' => 'API_KEY'
}

result = RestClient.get 'your-domotz-api-endpoint/public-api/v1/user',
  params: {
  }, headers: headers

p JSON.parse(result)

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "X-Api-Key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "your-domotz-api-endpoint/public-api/v1/user", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /user

Returns the User information

Example responses

200 Response

{
  "id": 0,
  "name": "string"
}

Responses

Status Meaning Description Schema
200 OK The user User

Schemas

APIUsageInformation

{
  "by_ip": [
    {
      "count": 0,
      "name": "string"
    }
  ],
  "by_key": [
    {
      "count": 0,
      "id": 0,
      "name": "string"
    }
  ],
  "by_resource": [
    {
      "count": 0,
      "name": "string"
    }
  ],
  "concurrent_allowed": 0,
  "daily_limit": 0,
  "daily_usage": 0
}

Information about Domotz API current usage and usage limits

Properties

Name Type Required Description
by_ip [object] false none
» count integer(int32) false The number of calls originated from that IP address
» name string false The IP address
by_key [object] false none
» count integer(int32) false The number of calls done using this key in the last 24 hours
» id integer(int32) false The ID of the API key
» name string false The mnemonic API key name
by_resource [object] false none
» count integer(int32) false The number of calls for the resource
» name string false The base resource name
concurrent_allowed integer(int32) false Number of allowed calls to the API in a minute.
daily_limit integer(int32) false Number of allowed calls to the API in a 24 hours span.
daily_usage integer(int32) false Number of API call performed in the last 24 hours.

AbstractDevice

{
  "authentication_status": "AUTHENTICATED",
  "details": {
    "room": "string",
    "snmp_read_community": "string",
    "snmp_write_community": "string",
    "zone": "string"
  },
  "display_name": "string",
  "first_seen_on": "2019-06-11T09:08:10Z",
  "id": 0,
  "importance": "VITAL",
  "main_id": 0,
  "protocol": "IP",
  "type": {
    "detected_id": 0,
    "id": 0
  },
  "user_data": {
    "model": "string",
    "name": "string",
    "type": 0,
    "vendor": "string"
  }
}

Base abstract class for all devices

Properties

Name Type Required Description
authentication_status string false When defined the device requires authentication info to perform extended discovery
  • REQUIRED: the device requires authentication, extended discovery is locked
  • PENDING: credentials have been submitted but not verified yet
  • WRONG_CREDENTIALS: device authentication failed
  • AUTHENTICATED: device authentication succeeded
details DeviceDetails false none
display_name string true none
first_seen_on string(date-time) false none
id integer(int32) true none
importance string false none
main_id integer(int32) false In a clustered configuration, the main device id
protocol string true none
type object false The device type, if recognised by domotz
» detected_id integer(int32) false none
» id integer(int32) false none
user_data object false none
» model string false none
» name string false none
» type integer(int32) false none
» vendor string false none

Enumerated Values

Property Value
authentication_status AUTHENTICATED
authentication_status NO_AUTHENTICATION
authentication_status PENDING
authentication_status REQUIRED
authentication_status WRONG_CREDENTIALS
importance VITAL
importance FLOATING
protocol IP
protocol DUMMY
protocol IP_EXTERNAL

AgentBase

{
  "access_right": {
    "api_enabled": true,
    "granting_user": {
      "name": "user@example.com"
    },
    "status": "OWNED"
  },
  "creation_time": "2019-06-11T09:08:10Z",
  "display_name": "string",
  "id": 0,
  "licence": {
    "activation_time": "2019-06-11T09:08:10Z",
    "bound_mac_address": "string",
    "code": "string",
    "expiration_time": "2019-06-11T09:08:10Z",
    "id": 0
  },
  "status": {
    "last_change": "2019-06-11T09:08:10Z",
    "value": "ONLINE"
  },
  "team": {
    "area": {
      "id": 0
    },
    "id": 0,
    "leader_id": 0,
    "name": "string"
  },
  "timezone": "string",
  "version": {
    "agent": "string",
    "package": "string"
  }
}

Properties

Name Type Required Description
access_right object false none
» api_enabled boolean false If false the agent plan doesn't allow for API access: you only can see this agent in the list
» granting_user object false none
»» name string(email) false none
» status string false
  • OWNED: you own this agent
  • PROPOSED: the owner proposed you to access the agent, you can accept or reject the offer
  • GRANTED: you accepted the collaboration request for this agent
  • ASSIGNED: your team leader has given you access to the agent
creation_time string(date-time) false none
display_name string true none
id integer(int32) true none
licence object false none
» activation_time string(date-time) false none
» bound_mac_address string false The MAC address of the primary interface of the device the software agent runs on
» code string false none
» expiration_time string(date-time) false none
» id integer(int32) false none
status object false none
» last_change string(date-time) false none
» value string false none
team object false The Team and Company Area information, only available for companies
» area object false none
»» id integer(int32) false none
» id integer(int32) false none
» leader_id integer(int32) false none
» name string false none
timezone string false none
version object false none
» agent string false none
» package string false none

Enumerated Values

Property Value
status OWNED
status GRANTED
status PROPOSED
status ASSIGNED
value ONLINE
value OFFLINE

AgentDetail

{
  "access_right": {
    "api_enabled": true,
    "granting_user": {
      "name": "user@example.com"
    },
    "status": "OWNED"
  },
  "creation_time": "2019-06-11T09:08:10Z",
  "display_name": "string",
  "id": 0,
  "licence": {
    "activation_time": "2019-06-11T09:08:10Z",
    "bound_mac_address": "string",
    "code": "string",
    "expiration_time": "2019-06-11T09:08:10Z",
    "id": 0
  },
  "status": {
    "last_change": "2019-06-11T09:08:10Z",
    "value": "ONLINE"
  },
  "team": {
    "area": {
      "id": 0
    },
    "id": 0,
    "leader_id": 0,
    "name": "string"
  },
  "timezone": "string",
  "version": {
    "agent": "string",
    "package": "string"
  },
  "listen_on": "string",
  "location": {
    "latitude": "string",
    "longitude": "string"
  }
}

Properties

allOf

Name Type Required Description
anonymous AgentBase false none

and

Name Type Required Description
anonymous object false none
» listen_on string false The local IP and port the Domotz Agent software is listening on if online - the last known value otherwise
» location object false none
»» latitude string false none
»» longitude string false none

AgentHistory

{
  "timestamp": "2019-06-11T09:08:10Z",
  "type": "CONNECTION_RECOVERED"
}

Properties

Name Type Required Description
timestamp string(date-time) true The time the sample was reported to Domotz
type string true The agent event type

Enumerated Values

Property Value
type CONNECTION_RECOVERED
type CONNECTION_LOST
type UP
type DOWN

AgentSecurityIssueEvent

{
  "data": {
    "agent_id": 0,
    "value": [
      {
        "port": 0,
        "type": "TCP_OPEN_PORT"
      }
    ]
  },
  "name": "agent_security_issue",
  "timestamp": "2019-06-11T09:08:10Z"
}

Triggered when Domotz detects a security issue

Properties

Name Type Required Description
data object false none
» agent_id integer(int32) false The id of the agent
» value [object] false none
»» port integer(int32) false none
»» type string false none
» name string true none
» timestamp string(date-time) true The timestamp of the event

Enumerated Values

Property Value
type TCP_OPEN_PORT
type UPNP_IGD_FORWARD
type UPNP_IGD_SERVICE
name agent_security_issue

AgentSpeedTestEvent

{
  "data": {
    "agent_id": 0,
    "status": "SPEED_TEST_ISSUE_DETECTED",
    "threshold": {
      "download": 0,
      "upload": 0
    },
    "value": {
      "download": 0,
      "upload": 0
    }
  },
  "name": "agent_speed_test",
  "timestamp": "2019-06-11T09:08:10Z"
}

Triggered when the measured Internet speed goes below the defined threshold

Properties

Name Type Required Description
data object false none
» agent_id integer(int32) false The id of the agent
» status string false none
» threshold object false none
»» download integer(int32) false The configured download threshold
»» upload integer(int32) false The configured upload threshold
» value object false none
»» download integer(int32) false The measured download value
»» upload integer(int32) false The measured upload value
» name string true none
» timestamp string(date-time) true The timestamp of the event

Enumerated Values

Property Value
status SPEED_TEST_ISSUE_DETECTED
status SPEED_TEST_ISSUE_RESOLVED
name agent_speed_test

AgentStatusEvent

{
  "data": {
    "agent_id": 0,
    "value": "UP"
  },
  "name": "agent_status",
  "timestamp": "2019-06-11T09:08:10Z"
}

Triggered when the agent connectivity status changes

Properties

Name Type Required Description
data object false none
» agent_id integer(int32) false The id of the agent
» value string false none
name string true none
timestamp string(date-time) true The timestamp of the event

Enumerated Values

Property Value
value UP
value DOWN
name agent_status

AlertProfile

{
  "description": "string",
  "events": [
    "device_status"
  ],
  "id": 0,
  "is_enabled": true,
  "name": "string",
  "tag": "string"
}

Properties

Name Type Required Description
description string false The description of the alert profile
events [string] false The list of events associated to the profile
id integer(int32) true The id of the event profile
is_enabled boolean false true if the event profile is enabled, false otherwise
name string false The symbolic name associated to the profile
tag string false A label associated to the profile

AlertProfileAgentBinding

{
  "alert_profile_id": 0
}

Properties

Name Type Required Description
alert_profile_id integer(int32) true The id of the alert profile

AlertProfileDeviceBinding

{
  "alert_profile_id": 0,
  "device_id": 0
}

Properties

Name Type Required Description
alert_profile_id integer(int32) true The id of the alert profile
device_id integer(int32) true none

ConnectionSession

{
  "allowed_ip": "string",
  "expiration": "2019-06-11T09:08:10Z",
  "id": 0,
  "link": "string",
  "port": 0,
  "protocol": "http"
}

Properties

Name Type Required Description
allowed_ip string true The only public IP address allowed to access the connection. It will be impossible to use the connection from other IP addresses. You can use 0.0.0.0 to allow access from any IP - For http abd https it is safe, since if you keep the connection link secret nobody will access the device. For tcp it is not recommended because a random port scan on our servers may allow an hostile actor to use the connection, accessing the device's tcp port as if it was in the agent's network.
expiration string(date-time) false The time after which the connection will be closed
id integer(int32) true The unique identifier of the connection
link string false Either the link to access the device's HTTP(s) interface in the browser or the host/port coordinates of the proxied TCP port, depending on the protocol (see protocol description in the request)
port integer(int32) true none
protocol string true The protocol wrapped by the connection:
- http/https: the link field in the reply will contain an https URL. A browser or a similar user agent must be used: the client must have cookies enabled and the capability of following 302 redirects. If the protocol is https the device's certificate will be accepted without checks and its information ignored (our server will act as a proxy).
- tcp: the link field will be in the form tcp://{host}:{port}. Any connection established (e.g. with telnet or ssh) on these coordinates will be securely forwarded to the requested port of the device.

Enumerated Values

Property Value
protocol http
protocol https
protocol tcp

DetectedDeviceType

{
  "capabilities": [
    "string"
  ],
  "id": 0,
  "identifier": "string",
  "label": "string",
  "type_id": 0
}

A device type, detected by the Domotz device identification feature

Properties

Name Type Required Description
capabilities [string] false The features of the device
id integer(int32) false An unique identifier of the type, referred in the Device entity
identifier string false The name of the type
label string false A human-readable short description of the type
type_id integer(int32) false The corresponding device type

DeviceBaseType

{
  "id": 0,
  "identifier": "string",
  "label": "string",
  "vital": true
}

A device type, either set by the user or as identified by the Domotz system

Properties

Name Type Required Description
id integer(int32) false An unique identifier of the type, referred in the Device entity
identifier string false The name of the type
label string false A human-readable short description of the type
vital boolean false Whether a device of this type will be marked as VITAL as soon as recognised

DeviceConnection

{
  "allowed_ip": "string",
  "port": 0,
  "protocol": "http"
}

Properties

Name Type Required Description
allowed_ip string true The only public IP address allowed to access the connection. It will be impossible to use the connection from other IP addresses. You can use 0.0.0.0 to allow access from any IP - For http abd https it is safe, since if you keep the connection link secret nobody will access the device. For tcp it is not recommended because a random port scan on our servers may allow an hostile actor to use the connection, accessing the device's tcp port as if it was in the agent's network.
port integer(int32) true none
protocol string true The protocol wrapped by the connection:
- http/https: the link field in the reply will contain an https URL. A browser or a similar user agent must be used: the client must have cookies enabled and the capability of following 302 redirects. If the protocol is https the device's certificate will be accepted without checks and its information ignored (our server will act as a proxy).
- tcp: the link field will be in the form tcp://{host}:{port}. Any connection established (e.g. with telnet or ssh) on these coordinates will be securely forwarded to the requested port of the device.

Enumerated Values

Property Value
protocol http
protocol https
protocol tcp

DeviceCredentials

{
  "password": "string",
  "username": "string"
}

Properties

Name Type Required Description
password string true password
username string true username

DeviceDetails

{
  "room": "string",
  "snmp_read_community": "string",
  "snmp_write_community": "string",
  "zone": "string"
}

Properties

Name Type Required Description
room string false none
snmp_read_community string false none
snmp_write_community string false none
zone string false none

DeviceDiscoveryEvent

{
  "data": {
    "agent_id": 0,
    "device_id": 0
  },
  "name": "agent_device_discovery",
  "timestamp": "2019-06-11T09:08:10Z"
}

Triggered when a new device appears on the network

Properties

Name Type Required Description
data object false none
» agent_id integer(int32) false The id of the agent
» device_id integer(int32) false The id of the device
name string true none
timestamp string(date-time) true The timestamp of the event

Enumerated Values

Property Value
name agent_device_discovery

DeviceHeartbeatLostEvent

{
  "data": {
    "agent_id": 0,
    "device_id": 0
  },
  "name": "device_heartbeat_lost",
  "timestamp": "2019-06-11T09:08:10Z"
}

Triggered when a device does not respond to a ping

Properties

Name Type Required Description
data object false none
» agent_id integer(int32) false The id of the agent
» device_id integer(int32) true The id of the device
name string true none
timestamp string(date-time) true The timestamp of the event

Enumerated Values

Property Value
name device_heartbeat_lost

DeviceHistory

{
  "details": {
    "new_ip": [
      "string"
    ],
    "old_ip": [
      "string"
    ]
  },
  "timestamp": "2019-06-11T09:08:10Z",
  "type": "IP_CHANGE"
}

Properties

Name Type Required Description
details object false none
» new_ip [string] false The new IP addresses
» old_ip [string] false The old IP addresses
timestamp string(date-time) true The time the sample was reported to Domotz
type string true The device event type

Enumerated Values

Property Value
type IP_CHANGE
type CREATED
type UP
type DOWN

DeviceIPChangeEvent

{
  "data": {
    "agent_id": 0,
    "device_id": 0,
    "old_ip_addresses": [
      "string"
    ],
    "value": [
      "string"
    ]
  },
  "name": "device_ip_change",
  "timestamp": "2019-06-11T09:08:10Z"
}

Triggered when the device IP address changes

Properties

Name Type Required Description
data object false none
» agent_id integer(int32) false The id of the agent
» device_id integer(int32) true The id of the device
» old_ip_addresses [string] false The list of previous IP addresses
» value [string] false The list of new IP addresses
name string true none
timestamp string(date-time) true The timestamp of the event

Enumerated Values

Property Value
name device_ip_change

DevicePowerAction

{
  "cycle": true,
  "off": true,
  "on": true,
  "software_reboot": true
}

Properties

Name Type Required Description
cycle boolean false Indicates that a power cycle on the device is possible. Available if the device is connected to just one PDU.
off boolean false Indicates that the device can be powered off. Available if the device is connected to one or more PDU.

In the latter case the operation will be performed on all available PDUs.

If there no PDU but there is one POE connection, the operation will still be available through that connection.

on boolean false Indicates that the device can be powered on. Available if the device is connected to one or more PDU.

In the latter case the operation will be performed on all available PDUs.

If there is no PDU but there is one POE connection, the operation will still available through that connection.
software_reboot boolean false Indicates that software reboot on the device is possible.

The operation availability depends on the device.

DeviceRTDHistorySample

{
  "lost_packet_count": 0,
  "max": "string",
  "median": "string",
  "min": "string",
  "sent_packet_count": 0,
  "timestamp": "2019-06-11T09:08:10Z"
}

Properties

Name Type Required Description
lost_packet_count integer(int32) false none
max string false none
median string false none
min string false none
sent_packet_count integer(int32) false none
timestamp string(date-time) true The time the sample was reported to Domotz

DeviceRTDIssueEvent

{
  "data": {
    "agent_id": 0,
    "device_id": 0,
    "status": "RTD_ISSUE_DETECTED",
    "threshold": {
      "latency": 0,
      "packet_loss_percentage": 0
    },
    "value": {
      "latency": 0,
      "packet_loss_percentage": 0
    }
  },
  "name": "device_rtd",
  "timestamp": "2019-06-11T09:08:10Z"
}

Triggered when the Round-Trip-Delay values of a device exceeds the defined thresholds

Properties

Name Type Required Description
data object false none
» agent_id integer(int32) false The id of the agent
» device_id integer(int32) true The id of the device
» status string false none
» threshold object false none
»» latency integer(int32) false The configured latency threshold
»» packet_loss_percentage integer(int32) false The configured packet loss percentage threshold
» value object false none
»» latency integer(int32) false The current latency value
»» packet_loss_percentage integer(int32) false The current packet loss percentage value
» name string true none
» timestamp string(date-time) true The timestamp of the event

Enumerated Values

Property Value
status RTD_ISSUE_DETECTED
status RTD_ISSUE_RESOLVED
name device_rtd

DeviceRTDStatistics

{
  "avg_max": "string",
  "avg_median": "string",
  "avg_min": "string",
  "device_id": 0,
  "latest_lost_packet_count": 0,
  "latest_median": "string",
  "latest_sent_packet_count": 0,
  "timestamp": "2019-06-11T09:08:10Z"
}

Properties

Name Type Required Description
avg_max string false none
avg_median string false none
avg_min string false none
device_id integer(int32) true none
latest_lost_packet_count integer(int32) false The number of lost packets of the latest collection sample
latest_median string false The median value of the latest collection sample
latest_sent_packet_count integer(int32) false The number of sent packets of the latest collection sample
timestamp string(date-time) true The timestamp of the latest update

DeviceSNMPEvent

{
  "data": {
    "agent_id": 0,
    "device_id": 0,
    "trigger_name": "string",
    "value": "string"
  },
  "name": "device_snmp",
  "timestamp": "2019-06-11T09:08:10Z"
}

Triggered when the status of an SNMP value changes

Properties

Name Type Required Description
data object false none
» agent_id integer(int32) false The id of the agent
» device_id integer(int32) true The id of the device
» trigger_name string false none
» value string false The current value of the SNMP sensor
name string true none
timestamp string(date-time) true The timestamp of the event

Enumerated Values

Property Value
name device_snmp

DeviceSnmpCommunity

{
  "read": "string",
  "write": "string"
}

Properties

Name Type Required Description
read string true Defines new read snmp community
write string false Defines new write snmp community (defaults to read community if not used)

DeviceStatusChangeEvent

{
  "data": {
    "agent_id": 0,
    "device_id": 0,
    "value": "UP"
  },
  "name": "device_status",
  "timestamp": "2019-06-11T09:08:10Z"
}

Triggered when the status of a device changes

Properties

Name Type Required Description
data object false none
» agent_id integer(int32) false The id of the agent
» device_id integer(int32) true The id of the device
» value string false none
name string true none
timestamp string(date-time) true The timestamp of the event

Enumerated Values

Property Value
value UP
value DOWN
name device_status

DeviceTCPEvent

{
  "data": {
    "agent_id": 0,
    "device_id": 0,
    "value": [
      {
        "port": 0,
        "status": "UP"
      }
    ]
  },
  "name": "device_tcp",
  "timestamp": "2019-06-11T09:08:10Z"
}

Triggered when the status of a monitored TCP service changes

Properties

Name Type Required Description
data object false none
» agent_id integer(int32) false The id of the agent
» device_id integer(int32) true The id of the device
» value [object] false none
»» port integer(int32) false none
»» status string false none
» name string true none
» timestamp string(date-time) true The timestamp of the event

Enumerated Values

Property Value
status UP
status DOWN
name device_tcp

DummyDevice

{
  "authentication_status": "AUTHENTICATED",
  "details": {
    "room": "string",
    "snmp_read_community": "string",
    "snmp_write_community": "string",
    "zone": "string"
  },
  "display_name": "string",
  "first_seen_on": "2019-06-11T09:08:10Z",
  "id": 0,
  "importance": "VITAL",
  "main_id": 0,
  "protocol": "IP",
  "type": {
    "detected_id": 0,
    "id": 0
  },
  "user_data": {
    "model": "string",
    "name": "string",
    "type": 0,
    "vendor": "string"
  }
}

Properties

allOf

Name Type Required Description
anonymous AbstractDevice false Base abstract class for all devices

and

Name Type Required Description
anonymous object false A device that has no network access whatsoever and cannot be discovered or interacted with by the agent. A user can create a Dummy Device to attach it to a power outlet so that it is easier to remember which port controls the device

ExternalIpDevice

{
  "authentication_status": "AUTHENTICATED",
  "details": {
    "room": "string",
    "snmp_read_community": "string",
    "snmp_write_community": "string",
    "zone": "string"
  },
  "display_name": "string",
  "first_seen_on": "2019-06-11T09:08:10Z",
  "id": 0,
  "importance": "VITAL",
  "main_id": 0,
  "protocol": "IP",
  "type": {
    "detected_id": 0,
    "id": 0
  },
  "user_data": {
    "model": "string",
    "name": "string",
    "type": 0,
    "vendor": "string"
  },
  "agent_reachable": true,
  "grace_period": 0,
  "ip_addresses": [
    "string"
  ],
  "last_status_change": "2019-06-11T09:08:10Z",
  "model": "string",
  "status": "ONLINE",
  "vendor": "string",
  "names": {
    "host": "string",
    "inspection": "string"
  }
}

Properties

allOf

Name Type Required Description
anonymous IpDevice false none

and

Name Type Required Description
anonymous object false A device added by the means of 'Advanced Monitoring': it is an IP device manually added by the user, no discoveries are done over it, just periodical ping to see whether it is reachable
» names object false none
»» host string false none
»» inspection string false none

IpDevice

{
  "authentication_status": "AUTHENTICATED",
  "details": {
    "room": "string",
    "snmp_read_community": "string",
    "snmp_write_community": "string",
    "zone": "string"
  },
  "display_name": "string",
  "first_seen_on": "2019-06-11T09:08:10Z",
  "id": 0,
  "importance": "VITAL",
  "main_id": 0,
  "protocol": "IP",
  "type": {
    "detected_id": 0,
    "id": 0
  },
  "user_data": {
    "model": "string",
    "name": "string",
    "type": 0,
    "vendor": "string"
  },
  "agent_reachable": true,
  "grace_period": 0,
  "ip_addresses": [
    "string"
  ],
  "last_status_change": "2019-06-11T09:08:10Z",
  "model": "string",
  "status": "ONLINE",
  "vendor": "string"
}

Properties

allOf

Name Type Required Description
anonymous AbstractDevice false Base abstract class for all devices

and

Name Type Required Description
anonymous object false Base abstract class for all IP devices
» agent_reachable boolean false When true the device is reachable by the agent over an IP network. When false Domotz knows about the status of the device by the means of another source e.g. a third party controller. This field is significant only when the status of the device is ONLINE and its value is false because it means that even if the IP device is up and running, many features aren't allowed, such as the direct connection or the TCP services monitoring.
» grace_period integer(int32) false The number of seconds a device must be unreachable before being declared DOWN
» ip_addresses [string] false none
» last_status_change string(date-time) false none
» model string false none
» status string false none
» vendor string false none

Enumerated Values

Property Value
status ONLINE
status OFFLINE
status DOWN
status HIDDEN

LocalIpDevice

{
  "authentication_status": "AUTHENTICATED",
  "details": {
    "room": "string",
    "snmp_read_community": "string",
    "snmp_write_community": "string",
    "zone": "string"
  },
  "display_name": "string",
  "first_seen_on": "2019-06-11T09:08:10Z",
  "id": 0,
  "importance": "VITAL",
  "main_id": 0,
  "protocol": "IP",
  "type": {
    "detected_id": 0,
    "id": 0
  },
  "user_data": {
    "model": "string",
    "name": "string",
    "type": 0,
    "vendor": "string"
  },
  "agent_reachable": true,
  "grace_period": 0,
  "ip_addresses": [
    "string"
  ],
  "last_status_change": "2019-06-11T09:08:10Z",
  "model": "string",
  "status": "ONLINE",
  "vendor": "string",
  "hw_address": "string",
  "is_jammed": true,
  "names": {
    "bonjour": "string",
    "dhcp": "string",
    "host": "string",
    "inspection": "string",
    "snmp": "string",
    "upnp": "string"
  }
}

Properties

allOf

Name Type Required Description
anonymous IpDevice false none

and

Name Type Required Description
anonymous object false Standard device, automatically discovered in the local IP network of the agent.
» hw_address string false MAC Address
» is_jammed boolean false When true, the Domotz Agent is blocking the device to access the Internet. The device can still reach every other device in the local network
» names object false none
»» bonjour string false none
»» dhcp string false none
»» host string false none
»» inspection string false none
»» snmp string false none
»» upnp string false none

NetworkSpeedSample

{
  "timestamp": "2019-06-11T09:08:10Z",
  "values": [
    0
  ]
}

A Network Speed Sample is the result of the measurement of the Internet download and upload speed, in bits per second, taken by the Agent

Properties

Name Type Required Description
timestamp string(date-time) false The time the sample was reported to Domotz
values [integer] false A pair of values: the download and upload speed, in Bit Per Seconds (bps), as measured by the Agent

SubnetIpDevice

{
  "authentication_status": "AUTHENTICATED",
  "details": {
    "room": "string",
    "snmp_read_community": "string",
    "snmp_write_community": "string",
    "zone": "string"
  },
  "display_name": "string",
  "first_seen_on": "2019-06-11T09:08:10Z",
  "id": 0,
  "importance": "VITAL",
  "main_id": 0,
  "protocol": "IP",
  "type": {
    "detected_id": 0,
    "id": 0
  },
  "user_data": {
    "model": "string",
    "name": "string",
    "type": 0,
    "vendor": "string"
  },
  "agent_reachable": true,
  "grace_period": 0,
  "ip_addresses": [
    "string"
  ],
  "last_status_change": "2019-06-11T09:08:10Z",
  "model": "string",
  "status": "ONLINE",
  "vendor": "string",
  "names": {
    "bonjour": "string",
    "host": "string",
    "inspection": "string",
    "snmp": "string",
    "upnp": "string"
  }
}

Properties

allOf

Name Type Required Description
anonymous IpDevice false none

and

Name Type Required Description
anonymous object false A device automatically discovered by the agent that exists in an IP subnet defined by the user. The agent reaches the device through a Level 3 switch or similar device, so it cannot get the MAC address or other level 2 information, such as DHCP lease data
» names object false none
»» bonjour string false none
»» host string false none
»» inspection string false none
»» snmp string false none
»» upnp string false none

User

{
  "id": 0,
  "name": "string"
}

Properties

Name Type Required Description
id integer(int32) false none
name string false none