post
https://hub.xyte.io/core/v1/organization/assets
Create an asset. Values for custom fields go in custom_fields.
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
This endpoint creates an asset. It sends an HTTP POST request to https://hub.xyte.io/core/v1/organization/assets.
Authorization
This endpoint requires Authorization.
Request Body
| Key | Type | Description |
|---|---|---|
| name | string | Asset name. |
| serial_number | string | Serial number. |
| space_id | integer | ID of the space the asset is in. Required on create. |
| purchased_at | string | Purchase date, ISO 8601. |
| comments | string | Free text. |
| icon_name | string | Icon shown in the portal. |
| manufacturer, device_model, device_type, status | string or object | A label name (created if new) or { "id": "<label uuid>" }. |
| custom_fields | object | See below. |
{
"name": "Conference Room PDU",
"serial_number": "RLNK-915R-00EA5A",
"space_id": 100,
"custom_fields": { "cmdb_tag": "TAG-0042" }
}Custom fields
custom_fields holds the values of the asset custom fields your organization defined in the portal (Settings → Assets). Keys are the field keys.
| Field type | Accepted value |
|---|---|
| text | A string, trimmed, up to 255 characters. |
| number | A number, or a plain decimal string such as "12" or "-1.5". Returned as a number. |
| date | YYYY-MM-DD. |
nullor""clears a value.- Leaving out
custom_fieldssets no values. - A key that is not a defined field fails the whole request.
Response
Returns the created asset:
| Key | Type | Description |
|---|---|---|
| id | string | Unique identifier of the asset (UUID). |
| name | string | Asset name. |
| serial_number | string | Serial number. |
| comments | string | Free text. |
| purchased_at | string | Purchase date, ISO 8601. |
| created_at | string | Creation time, ISO 8601. |
| icon_name | string | Icon shown in the portal. |
| space | object | id, name and full_path of the space. |
| manufacturer, device_model, device_type, status | object | id and name of the label, or null. |
| custom_fields | object | Custom field values, keyed by field key. {} when none are set. |
Errors
| Status | Description |
|---|---|
| 403 | A label belongs to another organization, or the space is the organization's root space. |
| 404 | The space does not exist in your organization. |
| 422 | space_id is missing, custom_fields is not an object, a key is not a defined field, or a value does not fit the field type. |
