0

List IT assets

by
Published Oct 17, 2025

Retrieve a paginated list of all IT assets managed by the organization. This is useful for getting a complete overview of your equipment inventory and understanding the state of each asset. For more info, visit [Assets](https://developer.deel.com/docs/deel-it-api#assets). **Token scopes**: `it-assets:read`

Script deel Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
/**
3
 * List IT assets
4
 * Retrieve a paginated list of all IT assets managed by the organization. This is useful for getting a complete overview of your equipment inventory and understanding the state of each asset. For more info, visit [Assets](https://developer.deel.com/docs/deel-it-api#assets).
5
 **Token scopes**: `it-assets:read`
6
 */
7
export async function main(
8
	auth: RT.Deel,
9
	cursor?: string | undefined,
10
	limit?: string | undefined,
11
	hris_profile_id?: string | undefined,
12
	location?:
13
		| 'WITH_USER'
14
		| 'AT_WAREHOUSE'
15
		| 'DEEL_WAREHOUSE'
16
		| 'ORGANIZATION_WAREHOUSE'
17
		| 'CLEARANCE_WAREHOUSE'
18
		| 'SUPPLIER'
19
		| 'WITH_COURIER'
20
		| 'WRITE_OFF'
21
		| undefined,
22
	category?:
23
		| 'ADAPTER'
24
		| 'CABLE'
25
		| 'CHAIR'
26
		| 'CHARGER'
27
		| 'DESK'
28
		| 'DESK_RISER'
29
		| 'DESK_TIDY'
30
		| 'DESKTOP'
31
		| 'DOCKING_STATION'
32
		| 'DONGLE'
33
		| 'FOOTREST'
34
		| 'HEADSET'
35
		| 'KEYBOARD'
36
		| 'LAPTOP'
37
		| 'LAPTOP_STAND'
38
		| 'MICE_TRACKPAD'
39
		| 'MOBILE_DEVICE'
40
		| 'MONITOR'
41
		| 'MONITOR_ARM'
42
		| 'OTHER'
43
		| 'PRINTER'
44
		| 'SHREDDER'
45
		| 'STANDING_MAT'
46
		| 'TABLET'
47
		| 'TASK_LIGHT'
48
		| 'WEBCAM'
49
		| 'WIFI_RANGE_EXTENDER'
50
		| 'WELCOME_PACK'
51
		| undefined,
52
	status?: 'ACTIVE' | 'ARCHIVED' | undefined
53
) {
54
	const url = new URL(`https://api.letsdeel.com/rest/v2/it/assets`)
55
	for (const [k, v] of [
56
		['cursor', cursor],
57
		['limit', limit],
58
		['hris_profile_id', hris_profile_id],
59
		['location', location],
60
		['category', category],
61
		['status', status]
62
	]) {
63
		if (v !== undefined && v !== '') {
64
			url.searchParams.append(k, v)
65
		}
66
	}
67
	const response = await fetch(url, {
68
		method: 'GET',
69
		headers: {
70
			Authorization: 'Bearer ' + auth.apiKey
71
		},
72
		body: undefined
73
	})
74
	if (!response.ok) {
75
		const text = await response.text()
76
		throw new Error(`${response.status} ${text}`)
77
	}
78
	return await response.json()
79
}
80