put
https://hub.xyte.io/core/v1/organization/assets/
Update an asset. Send only the keys you want to change.
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
This endpoint updates an asset. It sends an HTTP PUT request (PATCH works too) to https://hub.xyte.io/core/v1/organization/assets/{asset_id}. Send only the keys you want to change.
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 to move the asset to. |
| 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. |
{
"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. |
- A key you leave out keeps its value.
nullor""clears a value.- Leaving out
custom_fieldschanges nothing. - A key that is not a defined field fails the whole request. Drop keys of deleted fields when you write back an asset you read earlier.
Response
Returns the updated 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 asset or space does not exist in your organization. |
| 422 | custom_fields is not an object, a key is not a defined field, a value does not fit the field type, or the asset is moved to a space under a different customer. |
