Depot portal assets
This page is generated from the Depot route table. Every operation carries the permission it needs and the anchor an agent can link to.
GET /api/portal/v1/orgs/{clientID}/assets
Section titled “GET /api/portal/v1/orgs/{clientID}/assets”GETportal:assets:readportal facemspIdempotent
Source: [object Object]
listAssets pages the in-service devices by name (?page, ?pageSize, and ?siteId to narrow to one site).
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
clientID | path | string | Yes | |
page | query | string | No | |
pageSize | query | string | No | |
siteId | query | string | No |
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
200 | application/json, PageAsset | Success. |
400 | None | The request was refused. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | The identity does not hold portal:assets:read. |
404 | application/problem+json, ProblemDetails | No resource matches that id. |
200 response body
| Field | Type | Description |
|---|---|---|
itemsrequired | array of Asset | |
items[].ageDaysrequired | integer | |
items[].ageSourcerequired | string | |
items[].agentIdrequired | string | |
items[].assignedUser | string or null | |
items[].firstSeenAtrequired | string (date-time) | |
items[].hostnamerequired | string | |
items[].lastSeenAt | string (date-time) or null | |
items[].manufacturerrequired | string | |
items[].modelrequired | string | |
items[].namerequired | string | |
items[].osrequired | string | |
items[].osFamilyrequired | string | |
items[].siteId | string or null | |
items[].siteName | string or null | |
items[].typerequired | string | |
items[].warrantyEndsAt | string or null | |
pagerequired | integer | |
pageSizerequired | integer | |
totalrequired | integer |
Request samples
Section titled “Request samples”# Sign in first. __Host-portal_session is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.curl -X GET 'https://depot.example.com/api/portal/v1/orgs/<clientID>/assets?page=<page>&pageSize=<pageSize>&siteId=<siteId>' \ -H 'X-Csrf-Token: <portal-csrf>' \ -H 'Accept: application/json' \ -b '__Host-portal_session=<portal-session>'# Sign in first. __Host-portal_session is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
$headers = @{ 'X-Csrf-Token' = '<portal-csrf>' 'Accept' = 'application/json' 'Cookie' = '__Host-portal_session=<portal-session>'}
$response = Invoke-RestMethod ` -Method Get ` -Uri 'https://depot.example.com/api/portal/v1/orgs/<clientID>/assets?page=<page>&pageSize=<pageSize>&siteId=<siteId>' ` -Headers $headers
$response | ConvertTo-Json -Depth 10# Sign in first. __Host-portal_session is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
import requests
url = "https://depot.example.com/api/portal/v1/orgs/<clientID>/assets"params = { "page": "<page>", "pageSize": "<pageSize>", "siteId": "<siteId>",}headers = { "X-Csrf-Token": "<portal-csrf>", "Accept": "application/json",}cookies = { "__Host-portal_session": "<portal-session>",}
response = requests.get(url, params=params, headers=headers, cookies=cookies, timeout=30)response.raise_for_status()print(response.json())// Sign in first. __Host-portal_session is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.package main
import ( "fmt" "io" "log" "net/http")
func main() { req, err := http.NewRequest(http.MethodGet, "https://depot.example.com/api/portal/v1/orgs/<clientID>/assets?page=<page>&pageSize=<pageSize>&siteId=<siteId>", nil) if err != nil { log.Fatal(err) }
req.Header.Set("X-Csrf-Token", "<portal-csrf>") req.Header.Set("Accept", "application/json") req.AddCookie(&http.Cookie{Name: "__Host-portal_session", Value: "<portal-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. __Host-portal_session is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.// The session cookie is set by signing in. A script cannot set it itself.
const url = new URL("https://depot.example.com/api/portal/v1/orgs/<clientID>/assets");url.searchParams.set("page", "<page>");url.searchParams.set("pageSize", "<pageSize>");url.searchParams.set("siteId", "<siteId>");
const response = await fetch(url, { method: "GET", headers: { "X-Csrf-Token": "<portal-csrf>", "Accept": "application/json", }, credentials: "include",});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. __Host-portal_session is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.
using System;using System.Net.Http;
using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://depot.example.com/api/portal/v1/orgs/<clientID>/assets?page=<page>&pageSize=<pageSize>&siteId=<siteId>");request.Headers.TryAddWithoutValidation("X-Csrf-Token", "<portal-csrf>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "__Host-portal_session=<portal-session>");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());GET /api/portal/v1/orgs/{clientID}/assets/{agentID}
Section titled “GET /api/portal/v1/orgs/{clientID}/assets/{agentID}”GETportal:assets:readportal facemspIdempotent
Source: [object Object]
Get asset
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
agentID | path | string | Yes | |
clientID | path | string | Yes |
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
200 | application/json, AssetDetail | Success. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | The identity does not hold portal:assets:read. |
404 | application/problem+json, ProblemDetails | No resource matches that id. |
200 response body
| Field | Type | Description |
|---|---|---|
ageDaysrequired | integer | |
ageSourcerequired | string | |
agentIdrequired | string | |
assetTagrequired | string | |
assignedUser | string or null | |
assignedUsersrequired | array of AssetUser | |
assignedUsers[].assignmentKindrequired | string | |
assignedUsers[].namerequired | string | |
backuprequired | AssetBackupSummary | AssetBackupSummary is the device's last backup. |
backup.lastRunAt | string (date-time) or null | |
backup.lastSuccessAt | string (date-time) or null | |
backup.statusrequired | string | |
cpuModelrequired | string | |
firstSeenAtrequired | string (date-time) | |
hostnamerequired | string | |
lastSeenAt | string (date-time) or null | |
manufacturerrequired | string | |
modelrequired | string | |
namerequired | string | |
osrequired | string | |
osFamilyrequired | string | |
patchesrequired | AssetPatchSummary | AssetPatchSummary counts the device's updates. |
patches.failedrequired | integer | |
patches.outstandingrequired | integer | |
patches.statusrequired | string | |
serialNumberrequired | string | |
siteId | string or null | |
siteName | string or null | |
totalMemoryBytesrequired | integer | int64. |
typerequired | string | |
warrantyEndsAt | string or null |
Request samples
Section titled “Request samples”# Sign in first. __Host-portal_session is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.curl -X GET 'https://depot.example.com/api/portal/v1/orgs/<clientID>/assets/<agentID>' \ -H 'X-Csrf-Token: <portal-csrf>' \ -H 'Accept: application/json' \ -b '__Host-portal_session=<portal-session>'# Sign in first. __Host-portal_session is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
$headers = @{ 'X-Csrf-Token' = '<portal-csrf>' 'Accept' = 'application/json' 'Cookie' = '__Host-portal_session=<portal-session>'}
$response = Invoke-RestMethod ` -Method Get ` -Uri 'https://depot.example.com/api/portal/v1/orgs/<clientID>/assets/<agentID>' ` -Headers $headers
$response | ConvertTo-Json -Depth 10# Sign in first. __Host-portal_session is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
import requests
url = "https://depot.example.com/api/portal/v1/orgs/<clientID>/assets/<agentID>"headers = { "X-Csrf-Token": "<portal-csrf>", "Accept": "application/json",}cookies = { "__Host-portal_session": "<portal-session>",}
response = requests.get(url, headers=headers, cookies=cookies, timeout=30)response.raise_for_status()print(response.json())// Sign in first. __Host-portal_session is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.package main
import ( "fmt" "io" "log" "net/http")
func main() { req, err := http.NewRequest(http.MethodGet, "https://depot.example.com/api/portal/v1/orgs/<clientID>/assets/<agentID>", nil) if err != nil { log.Fatal(err) }
req.Header.Set("X-Csrf-Token", "<portal-csrf>") req.Header.Set("Accept", "application/json") req.AddCookie(&http.Cookie{Name: "__Host-portal_session", Value: "<portal-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. __Host-portal_session is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.// The session cookie is set by signing in. A script cannot set it itself.
const url = "https://depot.example.com/api/portal/v1/orgs/<clientID>/assets/<agentID>";
const response = await fetch(url, { method: "GET", headers: { "X-Csrf-Token": "<portal-csrf>", "Accept": "application/json", }, credentials: "include",});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. __Host-portal_session is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.
using System;using System.Net.Http;
using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://depot.example.com/api/portal/v1/orgs/<clientID>/assets/<agentID>");request.Headers.TryAddWithoutValidation("X-Csrf-Token", "<portal-csrf>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "__Host-portal_session=<portal-session>");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());Content is licensed CC BY 4.0. Code samples are MIT. Outpost and the Outpost mark are trademarks of Outpost Business Solutions, PBC and are not covered by either license.