Create rack
POST
/api/racks
const url = 'http://localhost:3000/api/racks';const options = { method: 'POST', headers: {cookie: 'session=<session>', 'Content-Type': 'application/json'}, body: '{"name":"example","siteId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","locationId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","units":42,"status":"active"}'};
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/racks \ --header 'Content-Type: application/json' \ --cookie session=<session> \ --data '{ "name": "example", "siteId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "locationId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "units": 42, "status": "active" }'Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
object
name
required
string
siteId
string format: uuid
locationId
string format: uuid
units
integer
status
string
Responses
Section titled “ Responses ”Rack created
Media type application/json
object
data
object
id
required
string format: uuid
name
required
string
siteId
string format: uuid
locationId
string format: uuid
units
integer
status
required
string
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
Example
{ "data": { "units": 42, "status": "active" }}Validation error
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"}