Create device
POST
/api/devices
const url = 'http://localhost:3000/api/devices';const options = { method: 'POST', headers: {cookie: 'session=<session>', 'Content-Type': 'application/json'}, body: '{"name":"example","status":"active","siteId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","locationId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","rackId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","manufacturerId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","deviceRoleId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","deviceTypeId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","platformId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","position":1,"uHeight":1,"platform":"example","model":"example","primaryIp":"example","description":"example","tags":["example"],"serialNumber":"example","assetTag":"example","notes":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:3000/api/devices \ --header 'Content-Type: application/json' \ --cookie session=<session> \ --data '{ "name": "example", "status": "active", "siteId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "locationId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "rackId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "manufacturerId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "deviceRoleId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "deviceTypeId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "platformId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "position": 1, "uHeight": 1, "platform": "example", "model": "example", "primaryIp": "example", "description": "example", "tags": [ "example" ], "serialNumber": "example", "assetTag": "example", "notes": "example" }'Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
object
name
required
string
status
string
siteId
string format: uuid
locationId
string format: uuid
rackId
string format: uuid
manufacturerId
string format: uuid
deviceRoleId
string format: uuid
deviceTypeId
When set, ports are auto-created from the device-type template
string format: uuid
platformId
string format: uuid
position
Rack unit — requires rackId; collisions return 400
integer
uHeight
integer
platform
Legacy free-text (prefer platformId)
string
model
Legacy free-text (prefer deviceTypeId)
string
primaryIp
string
description
string
tags
Array<string>
serialNumber
string
assetTag
string
notes
string
Responses
Section titled “ Responses ”Device created
Media type application/json
object
data
object
id
required
string format: uuid
name
required
string
status
required
string
siteId
string format: uuid
locationId
string format: uuid
rackId
string format: uuid
manufacturerId
string format: uuid
deviceRoleId
string format: uuid
deviceTypeId
string format: uuid
platformId
string format: uuid
position
Lowest occupied rack unit
integer
uHeight
Rack units occupied
integer
platform
Legacy free-text platform (prefer platformId)
string
model
Legacy free-text model (prefer deviceTypeId)
string
primaryIp
string
description
string
tags
Array<string>
serialNumber
string
assetTag
string
notes
string
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
Example
{ "data": { "status": "active", "uHeight": 1 }}Validation error (missing name, unknown FK, position without rack, or rack-slot collision)
Media type application/json
object
error
required
string
Example
{ "error": "Not found"}Not authenticated
Media type application/json
object
error
required
string
Example
{ "error": "Not found"}