Skip to content

Create device

POST
/api/devices
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" }'
Media type application/json
object
name
required
string
status
string
default: active
Allowed values: active planned staged offline decommissioned
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
>= 1
uHeight
integer
default: 1 >= 1
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

Device created

Media type application/json
object
data
object
id
required
string format: uuid
name
required
string
status
required
string
Allowed values: active planned staged offline decommissioned
siteId
string format: uuid
nullable
locationId
string format: uuid
nullable
rackId
string format: uuid
nullable
manufacturerId
string format: uuid
nullable
deviceRoleId
string format: uuid
nullable
deviceTypeId
string format: uuid
nullable
platformId
string format: uuid
nullable
position

Lowest occupied rack unit

integer
nullable
uHeight

Rack units occupied

integer
default: 1
platform

Legacy free-text platform (prefer platformId)

string
nullable
model

Legacy free-text model (prefer deviceTypeId)

string
nullable
primaryIp
string
nullable
description
string
nullable
tags
Array<string>
serialNumber
string
nullable
assetTag
string
nullable
notes
string
nullable
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"
}