Register device agent
curl --request POST \
--url https://api.trycomp.ai/v1/device-agent/register \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"name": "Jane's MacBook Pro",
"hostname": "janes-macbook-pro.local",
"platform": "macos",
"osVersion": "15.3.1",
"organizationId": "org_abc123def456"
}
EOFconst options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Jane\'s MacBook Pro',
hostname: 'janes-macbook-pro.local',
platform: 'macos',
osVersion: '15.3.1',
organizationId: 'org_abc123def456'
})
};
fetch('https://api.trycomp.ai/v1/device-agent/register', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.trycomp.ai/v1/device-agent/register"
payload = {
"name": "Jane's MacBook Pro",
"hostname": "janes-macbook-pro.local",
"platform": "macos",
"osVersion": "15.3.1",
"organizationId": "org_abc123def456"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)Device Agent
Register device agent | Comp AI API
Register a Comp AI Device Agent installation so employee endpoint checks can report into compliance tasks and device inventory.
POST
/
v1
/
device-agent
/
register
Register device agent
curl --request POST \
--url https://api.trycomp.ai/v1/device-agent/register \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"name": "Jane's MacBook Pro",
"hostname": "janes-macbook-pro.local",
"platform": "macos",
"osVersion": "15.3.1",
"organizationId": "org_abc123def456"
}
EOFconst options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Jane\'s MacBook Pro',
hostname: 'janes-macbook-pro.local',
platform: 'macos',
osVersion: '15.3.1',
organizationId: 'org_abc123def456'
})
};
fetch('https://api.trycomp.ai/v1/device-agent/register', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.trycomp.ai/v1/device-agent/register"
payload = {
"name": "Jane's MacBook Pro",
"hostname": "janes-macbook-pro.local",
"platform": "macos",
"osVersion": "15.3.1",
"organizationId": "org_abc123def456"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)Body
application/json
Human-readable computer name reported by the device
Example:
"Jane's MacBook Pro"
Network hostname of the device
Example:
"janes-macbook-pro.local"
Operating system family the device runs
Available options:
macos, windows, linux Example:
"macos"
Operating system version string reported by the device
Example:
"15.3.1"
ID of the organization to register the device under
Example:
"org_abc123def456"
Hardware serial number, used to match the device to an existing record
Example:
"C02XY1234567"
Hardware model identifier reported by the device
Example:
"MacBookPro18,3"
Version of the device agent performing the registration
Example:
"1.4.2"
Response
201 - undefined
Was this page helpful?

