Skip to content

Assets

Manage assets in your Smart Inventory.


List assets

GET /external/smart-inventory/asset/list

Returns all assets for your company.

curl -X GET https://nightly.api.trustview.eu/external/smart-inventory/asset/list \
  -H "X-API-Key: tvw_sk_live_your_key_here"
const res = await fetch(
  "https://nightly.api.trustview.eu/external/smart-inventory/asset/list",
  {
    headers: { "X-API-Key": "tvw_sk_live_your_key_here" },
  }
);
const assets = await res.json();
$ch = curl_init('https://nightly.api.trustview.eu/external/smart-inventory/asset/list');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-API-Key: tvw_sk_live_your_key_here']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = json_decode(curl_exec($ch));
curl_close($ch);
import requests

response = requests.get(
    "https://nightly.api.trustview.eu/external/smart-inventory/asset/list",
    headers={"X-API-Key": "tvw_sk_live_your_key_here"},
)
assets = response.json()

Response

[
  {
    "uniqueId": "6a054b8b9ae1a",
    "name": "Customer Database",
    "status": "active"
  }
]

Create an asset

POST /external/smart-inventory/asset/new

Creates a new asset.

curl -X POST https://nightly.api.trustview.eu/external/smart-inventory/asset/new \
  -H "X-API-Key: tvw_sk_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"name": "Customer Database", "description": "<p>Main customer data store</p>", "active": true}'
const res = await fetch(
  "https://nightly.api.trustview.eu/external/smart-inventory/asset/new",
  {
    method: "POST",
    headers: {
      "X-API-Key": "tvw_sk_live_your_key_here",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      name: "Customer Database",
      description: "<p>Main customer data store</p>",
      active: true,
    }),
  }
);
const asset = await res.json();
$ch = curl_init('https://nightly.api.trustview.eu/external/smart-inventory/asset/new');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'X-API-Key: tvw_sk_live_your_key_here',
    'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
    'name' => 'Customer Database',
    'description' => '<p>Main customer data store</p>',
    'active' => true,
]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = json_decode(curl_exec($ch));
curl_close($ch);
import requests

response = requests.post(
    "https://nightly.api.trustview.eu/external/smart-inventory/asset/new",
    headers={"X-API-Key": "tvw_sk_live_your_key_here"},
    json={
        "name": "Customer Database",
        "description": "<p>Main customer data store</p>",
        "active": True,
    },
)
asset = response.json()

Response

Returns the created asset object.


Get an asset

GET /external/smart-inventory/asset/{asset}/item

Retrieves a single asset by its unique ID.

Name In Type Description
asset path string Enter asset's unique ID

Tip

The asset's unique ID can be found in the address bar when viewing an asset.

curl -X GET https://nightly.api.trustview.eu/external/smart-inventory/asset/6a054b8b9ae1a/item \
  -H "X-API-Key: tvw_sk_live_your_key_here"
const res = await fetch(
  "https://nightly.api.trustview.eu/external/smart-inventory/asset/6a054b8b9ae1a/item",
  {
    headers: { "X-API-Key": "tvw_sk_live_your_key_here" },
  }
);
const asset = await res.json();
$ch = curl_init('https://nightly.api.trustview.eu/external/smart-inventory/asset/6a054b8b9ae1a/item');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-API-Key: tvw_sk_live_your_key_here']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = json_decode(curl_exec($ch));
curl_close($ch);
import requests

response = requests.get(
    "https://nightly.api.trustview.eu/external/smart-inventory/asset/6a054b8b9ae1a/item",
    headers={"X-API-Key": "tvw_sk_live_your_key_here"},
)
asset = response.json()

Update an asset

PATCH /external/smart-inventory/asset/{asset}/edit

Updates an existing asset. Send only the fields you want to change.

Name In Type Description
asset path string Enter asset's unique ID

Tip

The asset's unique ID can be found in the address bar when viewing an asset.

curl -X PATCH https://nightly.api.trustview.eu/external/smart-inventory/asset/6a054b8b9ae1a/edit \
  -H "X-API-Key: tvw_sk_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"name": "Customer Database (EU region)"}'
const res = await fetch(
  "https://nightly.api.trustview.eu/external/smart-inventory/asset/6a054b8b9ae1a/edit",
  {
    method: "PATCH",
    headers: {
      "X-API-Key": "tvw_sk_live_your_key_here",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ name: "Customer Database (EU region)" }),
  }
);
$ch = curl_init('https://nightly.api.trustview.eu/external/smart-inventory/asset/6a054b8b9ae1a/edit');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'X-API-Key: tvw_sk_live_your_key_here',
    'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['name' => 'Customer Database (EU region)']));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);
import requests

response = requests.patch(
    "https://nightly.api.trustview.eu/external/smart-inventory/asset/6a054b8b9ae1a/edit",
    headers={"X-API-Key": "tvw_sk_live_your_key_here"},
    json={"name": "Customer Database (EU region)"},
)

Response

Returns 204 No Content on success.


Delete an asset

DELETE /external/smart-inventory/asset/{asset}/delete

Removes an asset.

Name In Type Description
asset path string Enter asset's unique ID

Tip

The asset's unique ID can be found in the address bar when viewing an asset.

curl -X DELETE https://nightly.api.trustview.eu/external/smart-inventory/asset/6a054b8b9ae1a/delete \
  -H "X-API-Key: tvw_sk_live_your_key_here"
const res = await fetch(
  "https://nightly.api.trustview.eu/external/smart-inventory/asset/6a054b8b9ae1a/delete",
  {
    method: "DELETE",
    headers: { "X-API-Key": "tvw_sk_live_your_key_here" },
  }
);
$ch = curl_init('https://nightly.api.trustview.eu/external/smart-inventory/asset/6a054b8b9ae1a/delete');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-API-Key: tvw_sk_live_your_key_here']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);
import requests

response = requests.delete(
    "https://nightly.api.trustview.eu/external/smart-inventory/asset/6a054b8b9ae1a/delete",
    headers={"X-API-Key": "tvw_sk_live_your_key_here"},
)

Response

Returns 204 No Content on success.