curl --request GET \
--url https://api.leen.dev/v1/entities/devices/{device_id} \
--header 'X-API-KEY: <api-key>' \
--header 'X-CONNECTION-ID: <api-key>'import requests
url = "https://api.leen.dev/v1/entities/devices/{device_id}"
headers = {
"X-API-KEY": "<api-key>",
"X-CONNECTION-ID": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-API-KEY': '<api-key>', 'X-CONNECTION-ID': '<api-key>'}
};
fetch('https://api.leen.dev/v1/entities/devices/{device_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.leen.dev/v1/entities/devices/{device_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>",
"X-CONNECTION-ID: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.leen.dev/v1/entities/devices/{device_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("X-CONNECTION-ID", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.leen.dev/v1/entities/devices/{device_id}")
.header("X-API-KEY", "<api-key>")
.header("X-CONNECTION-ID", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.leen.dev/v1/entities/devices/{device_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
request["X-CONNECTION-ID"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"ad_info": {
"device_id": "<string>",
"domain": "<string>",
"org_unit": "<string>",
"site_name": "<string>"
},
"first_seen": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"installed_software": [
"<string>"
],
"last_seen": "2023-11-07T05:31:56Z",
"source_vendors": [
{
"vendor": "<string>",
"vendor_id": "<string>",
"agent_info": {
"agent_version": "<string>",
"policies": [
{}
],
"signature_version": "<string>"
}
}
],
"status": "active",
"cloud_metadata": {
"account_id": "<string>",
"availability_zone": "<string>",
"cloud_provider": "aws",
"image_id": "<string>",
"instance_id": "<string>",
"instance_type": "<string>",
"kernel_id": "<string>",
"region": "<string>",
"subnet_id": "<string>",
"vpc_id": "<string>"
},
"fqdns": [
"<string>"
],
"hostnames": [
"<string>"
],
"identities": [
{
"username": "<string>",
"user_sid": "<string>"
}
],
"ipv4s": [
"<string>"
],
"ipv6s": [
"<string>"
],
"mac_addresses": [
"<string>"
],
"os_major_version": "<string>",
"os_minor_version": "<string>",
"os_version": "<string>",
"platform": "mac",
"tags": [
{
"key": "<string>",
"source": "aws",
"value": "<string>"
}
],
"vendor_data": {}
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Get Device by ID
Retrieve a device by its ID (Leen’s UUID).
curl --request GET \
--url https://api.leen.dev/v1/entities/devices/{device_id} \
--header 'X-API-KEY: <api-key>' \
--header 'X-CONNECTION-ID: <api-key>'import requests
url = "https://api.leen.dev/v1/entities/devices/{device_id}"
headers = {
"X-API-KEY": "<api-key>",
"X-CONNECTION-ID": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-API-KEY': '<api-key>', 'X-CONNECTION-ID': '<api-key>'}
};
fetch('https://api.leen.dev/v1/entities/devices/{device_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.leen.dev/v1/entities/devices/{device_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>",
"X-CONNECTION-ID: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.leen.dev/v1/entities/devices/{device_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("X-CONNECTION-ID", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.leen.dev/v1/entities/devices/{device_id}")
.header("X-API-KEY", "<api-key>")
.header("X-CONNECTION-ID", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.leen.dev/v1/entities/devices/{device_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
request["X-CONNECTION-ID"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"ad_info": {
"device_id": "<string>",
"domain": "<string>",
"org_unit": "<string>",
"site_name": "<string>"
},
"first_seen": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"installed_software": [
"<string>"
],
"last_seen": "2023-11-07T05:31:56Z",
"source_vendors": [
{
"vendor": "<string>",
"vendor_id": "<string>",
"agent_info": {
"agent_version": "<string>",
"policies": [
{}
],
"signature_version": "<string>"
}
}
],
"status": "active",
"cloud_metadata": {
"account_id": "<string>",
"availability_zone": "<string>",
"cloud_provider": "aws",
"image_id": "<string>",
"instance_id": "<string>",
"instance_type": "<string>",
"kernel_id": "<string>",
"region": "<string>",
"subnet_id": "<string>",
"vpc_id": "<string>"
},
"fqdns": [
"<string>"
],
"hostnames": [
"<string>"
],
"identities": [
{
"username": "<string>",
"user_sid": "<string>"
}
],
"ipv4s": [
"<string>"
],
"ipv6s": [
"<string>"
],
"mac_addresses": [
"<string>"
],
"os_major_version": "<string>",
"os_minor_version": "<string>",
"os_version": "<string>",
"platform": "mac",
"tags": [
{
"key": "<string>",
"source": "aws",
"value": "<string>"
}
],
"vendor_data": {}
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Path Parameters
Response
Successful Response
Active Directory placement -- organisational unit and site -- where the tool reports it.
Show child attributes
Show child attributes
When the tool first registered this device. The tool's own timestamp, not when Leen synced it.
Leen's identifier for this device.
Software the tool reported as installed.
When the tool last had contact with the device. Use it to tell a decommissioned machine from one that simply has no findings.
The tool this device came from, and that tool's identifier for it. A list because the shape allows several; today a device carries exactly one.
Show child attributes
Show child attributes
Device state as the tool reports it. quarantined means the tool has isolated it; deleted means the tool no longer returns it.
active, offline, quarantined, unknown, deleted CloudMetadata, currently only AWS is supported
Show child attributes
Show child attributes
Fully qualified domain names for this device.
Hostnames the tool knows this device by. A device can have several.
Accounts associated with the device, such as its last logged-in user.
Show child attributes
Show child attributes
IPv4 addresses the tool last observed. Not necessarily current.
IPv6 addresses the tool last observed.
MAC addresses of the device's interfaces.
Major version, split out of os_version so it can be filtered on.
Minor version, split out of os_version.
Full operating system version string, as the tool reports it.
Operating system family, normalised across tools.
mac, windows, linux, unknown Tags the tool carries for this device.
Show child attributes
Show child attributes
Vendor specific pass through data, values can vary based on vendor