Assets
In Zendesk IT asset management, assets are individual records of an asset type. These are physical or digital things that you procure, allocate, maintain, and retire. For example, IT teams often have hardware assets, such as laptops and monitors, and software licenses. An asset is the record of an individual laptop or software license.
JSON format
ITAM Assets are represented as JSON objects with the following properties:
| Name | Type | Read-only | Mandatory | Description |
|---|---|---|---|---|
| asset_tag | string | false | false | The tag for the asset |
| asset_type_id | string | true | true | Id of the asset type |
| created_at | string | true | false | The time the asset record was added |
| custom_field_values | object | false | false | User-defined custom asset fields and values |
| external_id | string | false | false | An id you can use to link an asset to external data |
| id | string | true | false | Automatically assigned upon creation |
| location_id | string | false | false | Id of the asset location |
| manufacturer | string | false | false | The asset's manufacturer name |
| model | string | false | false | The asset's model name |
| name | string | false | true | Display name for the asset |
| notes | string | false | false | The asset's notes |
| organization_id | integer | false | false | Id of the organization the asset is associated with |
| purchase_cost | number | false | false | The asset's purchase cost |
| purchase_date | string | false | false | The asset's purchase date |
| serial_number | string | false | false | The asset's serial number |
| status_id | string | false | true | Id of current status of the asset |
| updated_at | string | true | false | The time of the asset's last update |
| url | string | true | false | Direct link to the specific asset |
| user_id | integer | false | false | Id of the user the asset is assigned to |
| vendor | string | false | false | The asset's vendor name |
| warranty_expiration | string | false | false | The asset's warranty expiration date |
List Assets
GET /api/v2/it_asset_management/assets
Lists all assets for all asset types.
Pagination
- Cursor pagination only.
Allowed For
- Agents
Code Samples
Curl
curl --request GET https://example.zendesk.com/api/v2/it_asset_management/assets \--header "Content-Type: application/json" \-u {email_address}/token:{api_token}
Go
import ("fmt""io""net/http")func main() {url := "https://example.zendesk.com/api/v2/it_asset_management/assets"method := "GET"req, err := http.NewRequest(method, url, nil)if err != nil {fmt.Println(err)return}req.Header.Add("Content-Type", "application/json")req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "{email_address}/token:{api_token}"client := &http.Client {}res, err := client.Do(req)if err != nil {fmt.Println(err)return}defer res.Body.Close()body, err := io.ReadAll(res.Body)if err != nil {fmt.Println(err)return}fmt.Println(string(body))}
Java
import com.squareup.okhttp.*;OkHttpClient client = new OkHttpClient();HttpUrl.Builder urlBuilder = HttpUrl.parse("https://example.zendesk.com/api/v2/it_asset_management/assets").newBuilder();String userCredentials = "your_email_address" + "/token:" + "your_api_token";String basicAuth = "Basic " + java.util.Base64.getEncoder().encodeToString(userCredentials.getBytes());Request request = new Request.Builder().url(urlBuilder.build()).method("GET", null).addHeader("Content-Type", "application/json").addHeader("Authorization", basicAuth).build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');var config = {method: 'GET',url: 'https://example.zendesk.com/api/v2/it_asset_management/assets',headers: {'Content-Type': 'application/json','Authorization': 'Basic <auth-value>', // Base64 encoded "{email_address}/token:{api_token}"},};axios(config).then(function (response) {console.log(JSON.stringify(response.data));}).catch(function (error) {console.log(error);});
Python
import requestsfrom requests.auth import HTTPBasicAuthurl = "https://example.zendesk.com/api/v2/it_asset_management/assets"headers = {"Content-Type": "application/json",}email_address = 'your_email_address'api_token = 'your_api_token'# Use basic authenticationauth = HTTPBasicAuth(f'{email_address}/token', api_token)response = requests.request("GET",url,auth=auth,headers=headers)print(response.text)
Ruby
require "net/http"require "base64"uri = URI("https://example.zendesk.com/api/v2/it_asset_management/assets")request = Net::HTTP::Get.new(uri, "Content-Type": "application/json")email = "your_email_address"api_token = "your_api_token"credentials = "#{email}/token:#{api_token}"encoded_credentials = Base64.strict_encode64(credentials)request["Authorization"] = "Basic #{encoded_credentials}"response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|http.request(request)end
curl - Get assets
curl https://{subdomain}.zendesk.com/api/v2/it_asset_management/assets.json \-v -u {email_address}/token:{api_token}
Example response(s)
200 OK
// Status 200 OK{"assets": [{"asset_tag": "loaner-ABC123XYZ","asset_type_id": "01K9BT5X0115ZVH1X6T37WYMTE","created_at": "2025-11-06T05:28:57Z","custom_field_values": {"compliance_state": null,"cpu_type": null,"device_ownership_type": null,"encryption_status": null,"enrollment_status": null,"firmware_version": null,"free_storage": null,"ip_address": "1.1.1.1","last_sign_in_timestamp": null,"last_sync_timestamp": null,"mac_address": null,"managed": "yes","operating_system": null,"os_version": null,"ram_total": "24Gb","storage_capacity": "1Tb","udid": null},"external_id": null,"id": "01K9BT7CVRJWP65442BWWCYAKV","location_id": null,"manufacturer": null,"model": null,"name": "My Laptop","notes": "Replacement out of cycle","organization_id": null,"purchase_cost": 999.99,"purchase_date": "2025-11-03","serial_number": "ABC123XYZ","status_id": "01K9BT5XE82QS5DG58F4J8WQWY","updated_at": "2025-11-06T05:39:35Z","url": "https://{subdomain}.zendesk.com/api/v2/it_asset_management/assets/01K9BT7CVRJWP65442BWWCYAKV.json","user_id": null,"vendor": null,"warranty_expiration": "2026-11-03"},{"asset_tag": null,"asset_type_id": "01K9BT5X2VZQH191VYA3GQN7NY","created_at": "2025-11-06T05:29:19Z","custom_field_values": {"compliance_state": null,"cpu_type": null,"device_ownership_type": null,"encryption_status": null,"enrollment_status": null,"firmware_version": null,"free_storage": null,"ip_address": null,"last_sign_in_timestamp": null,"last_sync_timestamp": null,"mac_address": null,"managed": null,"operating_system": null,"os_version": null,"ram_total": null,"storage_capacity": null,"udid": null},"external_id": null,"id": "01K9BT82RZTDJ2V0MH3SG8ET4A","location_id": null,"manufacturer": null,"model": null,"name": "My Desktop","notes": null,"organization_id": null,"purchase_cost": null,"purchase_date": null,"serial_number": null,"status_id": "01K9BT5XGEVP3TGTZDZK14YZJQ","updated_at": "2025-11-06T05:29:19Z","url": "https://{subdomain}.zendesk.com/api/v2/it_asset_management/assets/01K9BT82RZTDJ2V0MH3SG8ET4A.json","user_id": null,"vendor": null,"warranty_expiration": null}],"links": {"next": "https://{subdomain}.zendesk.com/api/v2/it_asset_management/assets.json?page%5Bafter%5D=eyJvIjoiLV9zY29yZSwtaWQiLCJ2IjoiYVFFQUFBQUFBQUFBY3hvQUFBQXdNVXRDUmxsWVJVc3lORUkzVVRCRVEwdEVXa1ZSTkRWQ1RRIn0","prev": null},"meta": {"after_cursor": "eyJvIjoiLV9zY29yZSwtaWQiLCJ2IjoiYVFFQUFBQUFBQUFBY3hvQUFBQXdNVXRDUmxsWVJVc3lORUkzVVRCRVEwdEVXa1ZSTkRWQ1RRIn0","before_cursor": null,"has_more": true}}
Show Asset
GET /api/v2/it_asset_management/assets/{asset_id}
Returns the asset with the specified id.
Allowed For
- Agents
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
| asset_id | string | Path | true | The id of the asset |
Code Samples
Curl
curl --request GET https://example.zendesk.com/api/v2/it_asset_management/assets/01K9AMAPSER316NHTJ2R36YAQ1 \--header "Content-Type: application/json" \-u {email_address}/token:{api_token}
Go
import ("fmt""io""net/http")func main() {url := "https://example.zendesk.com/api/v2/it_asset_management/assets/01K9AMAPSER316NHTJ2R36YAQ1"method := "GET"req, err := http.NewRequest(method, url, nil)if err != nil {fmt.Println(err)return}req.Header.Add("Content-Type", "application/json")req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "{email_address}/token:{api_token}"client := &http.Client {}res, err := client.Do(req)if err != nil {fmt.Println(err)return}defer res.Body.Close()body, err := io.ReadAll(res.Body)if err != nil {fmt.Println(err)return}fmt.Println(string(body))}
Java
import com.squareup.okhttp.*;OkHttpClient client = new OkHttpClient();HttpUrl.Builder urlBuilder = HttpUrl.parse("https://example.zendesk.com/api/v2/it_asset_management/assets/01K9AMAPSER316NHTJ2R36YAQ1").newBuilder();String userCredentials = "your_email_address" + "/token:" + "your_api_token";String basicAuth = "Basic " + java.util.Base64.getEncoder().encodeToString(userCredentials.getBytes());Request request = new Request.Builder().url(urlBuilder.build()).method("GET", null).addHeader("Content-Type", "application/json").addHeader("Authorization", basicAuth).build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');var config = {method: 'GET',url: 'https://example.zendesk.com/api/v2/it_asset_management/assets/01K9AMAPSER316NHTJ2R36YAQ1',headers: {'Content-Type': 'application/json','Authorization': 'Basic <auth-value>', // Base64 encoded "{email_address}/token:{api_token}"},};axios(config).then(function (response) {console.log(JSON.stringify(response.data));}).catch(function (error) {console.log(error);});
Python
import requestsfrom requests.auth import HTTPBasicAuthurl = "https://example.zendesk.com/api/v2/it_asset_management/assets/01K9AMAPSER316NHTJ2R36YAQ1"headers = {"Content-Type": "application/json",}email_address = 'your_email_address'api_token = 'your_api_token'# Use basic authenticationauth = HTTPBasicAuth(f'{email_address}/token', api_token)response = requests.request("GET",url,auth=auth,headers=headers)print(response.text)
Ruby
require "net/http"require "base64"uri = URI("https://example.zendesk.com/api/v2/it_asset_management/assets/01K9AMAPSER316NHTJ2R36YAQ1")request = Net::HTTP::Get.new(uri, "Content-Type": "application/json")email = "your_email_address"api_token = "your_api_token"credentials = "#{email}/token:#{api_token}"encoded_credentials = Base64.strict_encode64(credentials)request["Authorization"] = "Basic #{encoded_credentials}"response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|http.request(request)end
curl - Get asset by id
curl https://{subdomain}.zendesk.com/api/v2/it_asset_management/assets/{asset_id}.json \-v -u {email_address}/token:{api_token}
Example response(s)
200 OK
// Status 200 OK{"asset": {"asset_tag": "loaner-ABC123XYZ","asset_type_id": "01K9BT5X0115ZVH1X6T37WYMTE","created_at": "2025-11-06T05:28:57Z","custom_field_values": {"compliance_state": null,"cpu_type": null,"device_ownership_type": null,"encryption_status": null,"enrollment_status": null,"firmware_version": null,"free_storage": null,"ip_address": "1.1.1.1","last_sign_in_timestamp": null,"last_sync_timestamp": null,"mac_address": null,"managed": "yes","operating_system": null,"os_version": null,"ram_total": "24Gb","storage_capacity": "1Tb","udid": null},"external_id": null,"id": "01K9BT7CVRJWP65442BWWCYAKV","location_id": null,"manufacturer": null,"model": null,"name": "My Laptop","notes": "Replacement out of cycle","organization_id": null,"purchase_cost": 999.99,"purchase_date": "2025-11-03","serial_number": "ABC123XYZ","status_id": "01K9BT5XE82QS5DG58F4J8WQWY","updated_at": "2025-11-06T05:39:35Z","url": "https://{subdomain}.zendesk.com/api/v2/it_asset_management/assets/01K9BT7CVRJWP65442BWWCYAKV.json","user_id": null,"vendor": null,"warranty_expiration": "2026-11-03"}}
Create Asset
POST /api/v2/it_asset_management/assets
Creates an asset.
Allowed For
- Admins
Example body
{"asset": {"asset_type_id": "01K9BW852KHGF59W0TM02J2F6H","custom_field_values": {"ip_address": "1.2.3.4"},"name": "Laptop 1","notes": "Replacing a laptop for someone","status_id": "01K9BW8DD6Z2N7TXM313N8BR69"}}
Code Samples
Curl
curl --request POST https://example.zendesk.com/api/v2/it_asset_management/assets \--header "Content-Type: application/json" \-u {email_address}/token:{api_token} \--data-raw '{"asset": {"asset_type_id": "01K9BW852KHGF59W0TM02J2F6H","custom_field_values": {"ip_address": "1.2.3.4"},"name": "Laptop 1","notes": "Replacing a laptop for someone","status_id": "01K9BW8DD6Z2N7TXM313N8BR69"}}'
Go
import ("fmt""io""net/http""strings")func main() {url := "https://example.zendesk.com/api/v2/it_asset_management/assets"method := "POST"payload := strings.NewReader(`{"asset": {"asset_type_id": "01K9BW852KHGF59W0TM02J2F6H","custom_field_values": {"ip_address": "1.2.3.4"},"name": "Laptop 1","notes": "Replacing a laptop for someone","status_id": "01K9BW8DD6Z2N7TXM313N8BR69"}}`)req, err := http.NewRequest(method, url, payload)if err != nil {fmt.Println(err)return}req.Header.Add("Content-Type", "application/json")req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "{email_address}/token:{api_token}"client := &http.Client {}res, err := client.Do(req)if err != nil {fmt.Println(err)return}defer res.Body.Close()body, err := io.ReadAll(res.Body)if err != nil {fmt.Println(err)return}fmt.Println(string(body))}
Java
import com.squareup.okhttp.*;OkHttpClient client = new OkHttpClient();HttpUrl.Builder urlBuilder = HttpUrl.parse("https://example.zendesk.com/api/v2/it_asset_management/assets").newBuilder();RequestBody body = RequestBody.create(MediaType.parse("application/json"),"""{\"asset\": {\"asset_type_id\": \"01K9BW852KHGF59W0TM02J2F6H\",\"custom_field_values\": {\"ip_address\": \"1.2.3.4\"},\"name\": \"Laptop 1\",\"notes\": \"Replacing a laptop for someone\",\"status_id\": \"01K9BW8DD6Z2N7TXM313N8BR69\"}}""");String userCredentials = "your_email_address" + "/token:" + "your_api_token";String basicAuth = "Basic " + java.util.Base64.getEncoder().encodeToString(userCredentials.getBytes());Request request = new Request.Builder().url(urlBuilder.build()).method("POST", body).addHeader("Content-Type", "application/json").addHeader("Authorization", basicAuth).build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');var data = JSON.stringify({"asset": {"asset_type_id": "01K9BW852KHGF59W0TM02J2F6H","custom_field_values": {"ip_address": "1.2.3.4"},"name": "Laptop 1","notes": "Replacing a laptop for someone","status_id": "01K9BW8DD6Z2N7TXM313N8BR69"}});var config = {method: 'POST',url: 'https://example.zendesk.com/api/v2/it_asset_management/assets',headers: {'Content-Type': 'application/json','Authorization': 'Basic <auth-value>', // Base64 encoded "{email_address}/token:{api_token}"},data : data,};axios(config).then(function (response) {console.log(JSON.stringify(response.data));}).catch(function (error) {console.log(error);});
Python
import requestsimport jsonfrom requests.auth import HTTPBasicAuthurl = "https://example.zendesk.com/api/v2/it_asset_management/assets"payload = json.loads("""{"asset": {"asset_type_id": "01K9BW852KHGF59W0TM02J2F6H","custom_field_values": {"ip_address": "1.2.3.4"},"name": "Laptop 1","notes": "Replacing a laptop for someone","status_id": "01K9BW8DD6Z2N7TXM313N8BR69"}}""")headers = {"Content-Type": "application/json",}email_address = 'your_email_address'api_token = 'your_api_token'# Use basic authenticationauth = HTTPBasicAuth(f'{email_address}/token', api_token)response = requests.request("POST",url,auth=auth,headers=headers,json=payload)print(response.text)
Ruby
require "net/http"require "base64"uri = URI("https://example.zendesk.com/api/v2/it_asset_management/assets")request = Net::HTTP::Post.new(uri, "Content-Type": "application/json")request.body = %q({"asset": {"asset_type_id": "01K9BW852KHGF59W0TM02J2F6H","custom_field_values": {"ip_address": "1.2.3.4"},"name": "Laptop 1","notes": "Replacing a laptop for someone","status_id": "01K9BW8DD6Z2N7TXM313N8BR69"}})email = "your_email_address"api_token = "your_api_token"credentials = "#{email}/token:#{api_token}"encoded_credentials = Base64.strict_encode64(credentials)request["Authorization"] = "Basic #{encoded_credentials}"response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|http.request(request)end
curl - Create asset
For clarity, the example places the JSON in a separate file and imports it into the cURL statement
my_asset.json
{"asset": {"name": "Laptop","custom_field_values": {"manufacturer": "Apple","model": "MacBookPro18,1"}}}
curl - Create asset snippet
curl https://{subdomain}.zendesk.com/api/v2/it_asset_management/assets.json \-d @my_asset.json \-H "Content-Type: application/json" -v -u {email_address}/token:{api_token} -X POST
Example response(s)
201 Created
// Status 201 Created{"asset": {"asset_tag": "loaner-ABC123XYZ","asset_type_id": "01K9BT5X0115ZVH1X6T37WYMTE","created_at": "2025-11-06T05:28:57Z","custom_field_values": {"compliance_state": null,"cpu_type": null,"device_ownership_type": null,"encryption_status": null,"enrollment_status": null,"firmware_version": null,"free_storage": null,"ip_address": "1.1.1.1","last_sign_in_timestamp": null,"last_sync_timestamp": null,"mac_address": null,"managed": "yes","operating_system": null,"os_version": null,"ram_total": "24Gb","storage_capacity": "1Tb","udid": null},"external_id": null,"id": "01K9BT7CVRJWP65442BWWCYAKV","location_id": null,"manufacturer": null,"model": null,"name": "My Laptop","notes": "Replacement out of cycle","organization_id": null,"purchase_cost": 999.99,"purchase_date": "2025-11-03","serial_number": "ABC123XYZ","status_id": "01K9BT5XE82QS5DG58F4J8WQWY","updated_at": "2025-11-06T05:39:35Z","url": "https://{subdomain}.zendesk.com/api/v2/it_asset_management/assets/01K9BT7CVRJWP65442BWWCYAKV.json","user_id": null,"vendor": null,"warranty_expiration": "2026-11-03"}}
Update Asset
PATCH /api/v2/it_asset_management/assets/{asset_id}
Updates an individual asset. This request takes an asset object that specifies the properties to update, with custom field values nested within a custom_field_values object. Values are updated only for the properties specified in the request. Any asset properties that aren't specified in the request are unaffected, and their values are preserved for the asset.
Allowed For
- Admins
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
| asset_id | string | Path | true | The id of the asset |
Code Samples
Curl
curl --request PATCH https://example.zendesk.com/api/v2/it_asset_management/assets/01K9AMAPSER316NHTJ2R36YAQ1 \--header "Content-Type: application/json" \-u {email_address}/token:{api_token}
Go
import ("fmt""io""net/http")func main() {url := "https://example.zendesk.com/api/v2/it_asset_management/assets/01K9AMAPSER316NHTJ2R36YAQ1"method := "PATCH"req, err := http.NewRequest(method, url, nil)if err != nil {fmt.Println(err)return}req.Header.Add("Content-Type", "application/json")req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "{email_address}/token:{api_token}"client := &http.Client {}res, err := client.Do(req)if err != nil {fmt.Println(err)return}defer res.Body.Close()body, err := io.ReadAll(res.Body)if err != nil {fmt.Println(err)return}fmt.Println(string(body))}
Java
import com.squareup.okhttp.*;OkHttpClient client = new OkHttpClient();HttpUrl.Builder urlBuilder = HttpUrl.parse("https://example.zendesk.com/api/v2/it_asset_management/assets/01K9AMAPSER316NHTJ2R36YAQ1").newBuilder();RequestBody body = RequestBody.create(MediaType.parse("application/json"),"""""");String userCredentials = "your_email_address" + "/token:" + "your_api_token";String basicAuth = "Basic " + java.util.Base64.getEncoder().encodeToString(userCredentials.getBytes());Request request = new Request.Builder().url(urlBuilder.build()).method("PATCH", body).addHeader("Content-Type", "application/json").addHeader("Authorization", basicAuth).build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');var config = {method: 'PATCH',url: 'https://example.zendesk.com/api/v2/it_asset_management/assets/01K9AMAPSER316NHTJ2R36YAQ1',headers: {'Content-Type': 'application/json','Authorization': 'Basic <auth-value>', // Base64 encoded "{email_address}/token:{api_token}"},};axios(config).then(function (response) {console.log(JSON.stringify(response.data));}).catch(function (error) {console.log(error);});
Python
import requestsfrom requests.auth import HTTPBasicAuthurl = "https://example.zendesk.com/api/v2/it_asset_management/assets/01K9AMAPSER316NHTJ2R36YAQ1"headers = {"Content-Type": "application/json",}email_address = 'your_email_address'api_token = 'your_api_token'# Use basic authenticationauth = HTTPBasicAuth(f'{email_address}/token', api_token)response = requests.request("PATCH",url,auth=auth,headers=headers)print(response.text)
Ruby
require "net/http"require "base64"uri = URI("https://example.zendesk.com/api/v2/it_asset_management/assets/01K9AMAPSER316NHTJ2R36YAQ1")request = Net::HTTP::Patch.new(uri, "Content-Type": "application/json")email = "your_email_address"api_token = "your_api_token"credentials = "#{email}/token:#{api_token}"encoded_credentials = Base64.strict_encode64(credentials)request["Authorization"] = "Basic #{encoded_credentials}"response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|http.request(request)end
curl - Update asset by id
For clarity, the example places the JSON in a separate file and imports it into the cURL statement
updated_asset.json
{"asset": {"notes": "Updating an asset","custom_field_values": {"managed": "no","ip_address": "1.2.3.4"}}}
curl - Update asset by id snippet
curl https://{subdomain}.zendesk.com/api/v2/it_asset_management/assets/{asset_id}.json \-d @updated_asset.json \-H "Content-Type: application/json" -X PATCH \-v -u {email_address}/token:{api_token}
Example response(s)
200 OK
// Status 200 OK{"asset": {"asset_tag": "loaner-ABC123XYZ","asset_type_id": "01K9BT5X0115ZVH1X6T37WYMTE","created_at": "2025-11-06T05:28:57Z","custom_field_values": {"compliance_state": null,"cpu_type": null,"device_ownership_type": null,"encryption_status": null,"enrollment_status": null,"firmware_version": null,"free_storage": null,"ip_address": "1.1.1.1","last_sign_in_timestamp": null,"last_sync_timestamp": null,"mac_address": null,"managed": "yes","operating_system": null,"os_version": null,"ram_total": "24Gb","storage_capacity": "1Tb","udid": null},"external_id": null,"id": "01K9BT7CVRJWP65442BWWCYAKV","location_id": null,"manufacturer": null,"model": null,"name": "My Laptop","notes": "Replacement out of cycle","organization_id": null,"purchase_cost": 999.99,"purchase_date": "2025-11-03","serial_number": "ABC123XYZ","status_id": "01K9BT5XE82QS5DG58F4J8WQWY","updated_at": "2025-11-06T05:39:35Z","url": "https://{subdomain}.zendesk.com/api/v2/it_asset_management/assets/01K9BT7CVRJWP65442BWWCYAKV.json","user_id": null,"vendor": null,"warranty_expiration": "2026-11-03"}}
Delete Asset
DELETE /api/v2/it_asset_management/assets/{asset_id}
Deletes an asset with the specified id.
Allowed For
- Admins
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
| asset_id | string | Path | true | The id of the asset |
Code Samples
Curl
curl --request DELETE https://example.zendesk.com/api/v2/it_asset_management/assets/01K9AMAPSER316NHTJ2R36YAQ1 \--header "Content-Type: application/json" \-u {email_address}/token:{api_token}
Go
import ("fmt""io""net/http")func main() {url := "https://example.zendesk.com/api/v2/it_asset_management/assets/01K9AMAPSER316NHTJ2R36YAQ1"method := "DELETE"req, err := http.NewRequest(method, url, nil)if err != nil {fmt.Println(err)return}req.Header.Add("Content-Type", "application/json")req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "{email_address}/token:{api_token}"client := &http.Client {}res, err := client.Do(req)if err != nil {fmt.Println(err)return}defer res.Body.Close()body, err := io.ReadAll(res.Body)if err != nil {fmt.Println(err)return}fmt.Println(string(body))}
Java
import com.squareup.okhttp.*;OkHttpClient client = new OkHttpClient();HttpUrl.Builder urlBuilder = HttpUrl.parse("https://example.zendesk.com/api/v2/it_asset_management/assets/01K9AMAPSER316NHTJ2R36YAQ1").newBuilder();String userCredentials = "your_email_address" + "/token:" + "your_api_token";String basicAuth = "Basic " + java.util.Base64.getEncoder().encodeToString(userCredentials.getBytes());Request request = new Request.Builder().url(urlBuilder.build()).method("DELETE", null).addHeader("Content-Type", "application/json").addHeader("Authorization", basicAuth).build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');var config = {method: 'DELETE',url: 'https://example.zendesk.com/api/v2/it_asset_management/assets/01K9AMAPSER316NHTJ2R36YAQ1',headers: {'Content-Type': 'application/json','Authorization': 'Basic <auth-value>', // Base64 encoded "{email_address}/token:{api_token}"},};axios(config).then(function (response) {console.log(JSON.stringify(response.data));}).catch(function (error) {console.log(error);});
Python
import requestsfrom requests.auth import HTTPBasicAuthurl = "https://example.zendesk.com/api/v2/it_asset_management/assets/01K9AMAPSER316NHTJ2R36YAQ1"headers = {"Content-Type": "application/json",}email_address = 'your_email_address'api_token = 'your_api_token'# Use basic authenticationauth = HTTPBasicAuth(f'{email_address}/token', api_token)response = requests.request("DELETE",url,auth=auth,headers=headers)print(response.text)
Ruby
require "net/http"require "base64"uri = URI("https://example.zendesk.com/api/v2/it_asset_management/assets/01K9AMAPSER316NHTJ2R36YAQ1")request = Net::HTTP::Delete.new(uri, "Content-Type": "application/json")email = "your_email_address"api_token = "your_api_token"credentials = "#{email}/token:#{api_token}"encoded_credentials = Base64.strict_encode64(credentials)request["Authorization"] = "Basic #{encoded_credentials}"response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|http.request(request)end
curl - Delete asset by id
curl https://{subdomain}.zendesk.com/api/v2/it_asset_management/assets/{asset_id}.json \-X DELETE \-v -u {email_address}/token:{api_token}
Example response(s)
204 No Content
// Status 204 No Contentnull
Asset Bulk Jobs
POST /api/v2/it_asset_management/assets/jobs
Queues a background job to perform bulk actions on up to 100 asset records per request.
Takes a job object with two nested fields:
action, one of:"create""update""delete""delete_by_external_id"
items- For a
"create"action, an array of JSON objects representing the assets being created - For an
"update"action, an array of JSON objects representing the assets being updated (must includeidattribute) - For a
"delete"action, an array of strings representing Zendesk asset ids - For a
"delete_by_external_id"action, an array of strings representing external ids
- For a
Note: For create and update actions, the asset_type_id, status_id, and location_id fields can be specified using either the ID or the name of the resource. For example, you can use "asset_type_id": "01K9BW852KHGF59W0TM02J2F6H" or "asset_type": "Laptop".
Allowed For
- Admins
Response
This endpoint returns a job_status JSON object and queues a background job to do the work. Use the Show Job Status endpoint to check for the job's completion. Only a certain number of jobs can be queued or running at the same time. See Job limit for more information.
Example body
{"job": {"action": "create","items": [{"asset_type_id": "01K9BW852KHGF59W0TM02J2F6H","custom_field_values": {"manufacturer": "Apple","model": "MacBookPro18,1"},"name": "Laptop 1","status_id": "01K9BW8DD6Z2N7TXM313N8BR69"},{"asset_type_id": "01K9BW852KHGF59W0TM02J2F6H","custom_field_values": {"manufacturer": "Dell","model": "XPS 15"},"name": "Laptop 2","status_id": "01K9BW8DD6Z2N7TXM313N8BR69"}]}}
Code Samples
Curl
curl --request POST https://example.zendesk.com/api/v2/it_asset_management/assets/jobs \--header "Content-Type: application/json" \-u {email_address}/token:{api_token} \--data-raw '{"job": {"action": "create","items": [{"asset_type_id": "01K9BW852KHGF59W0TM02J2F6H","custom_field_values": {"manufacturer": "Apple","model": "MacBookPro18,1"},"name": "Laptop 1","status_id": "01K9BW8DD6Z2N7TXM313N8BR69"},{"asset_type_id": "01K9BW852KHGF59W0TM02J2F6H","custom_field_values": {"manufacturer": "Dell","model": "XPS 15"},"name": "Laptop 2","status_id": "01K9BW8DD6Z2N7TXM313N8BR69"}]}}'
Go
import ("fmt""io""net/http""strings")func main() {url := "https://example.zendesk.com/api/v2/it_asset_management/assets/jobs"method := "POST"payload := strings.NewReader(`{"job": {"action": "create","items": [{"asset_type_id": "01K9BW852KHGF59W0TM02J2F6H","custom_field_values": {"manufacturer": "Apple","model": "MacBookPro18,1"},"name": "Laptop 1","status_id": "01K9BW8DD6Z2N7TXM313N8BR69"},{"asset_type_id": "01K9BW852KHGF59W0TM02J2F6H","custom_field_values": {"manufacturer": "Dell","model": "XPS 15"},"name": "Laptop 2","status_id": "01K9BW8DD6Z2N7TXM313N8BR69"}]}}`)req, err := http.NewRequest(method, url, payload)if err != nil {fmt.Println(err)return}req.Header.Add("Content-Type", "application/json")req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "{email_address}/token:{api_token}"client := &http.Client {}res, err := client.Do(req)if err != nil {fmt.Println(err)return}defer res.Body.Close()body, err := io.ReadAll(res.Body)if err != nil {fmt.Println(err)return}fmt.Println(string(body))}
Java
import com.squareup.okhttp.*;OkHttpClient client = new OkHttpClient();HttpUrl.Builder urlBuilder = HttpUrl.parse("https://example.zendesk.com/api/v2/it_asset_management/assets/jobs").newBuilder();RequestBody body = RequestBody.create(MediaType.parse("application/json"),"""{\"job\": {\"action\": \"create\",\"items\": [{\"asset_type_id\": \"01K9BW852KHGF59W0TM02J2F6H\",\"custom_field_values\": {\"manufacturer\": \"Apple\",\"model\": \"MacBookPro18,1\"},\"name\": \"Laptop 1\",\"status_id\": \"01K9BW8DD6Z2N7TXM313N8BR69\"},{\"asset_type_id\": \"01K9BW852KHGF59W0TM02J2F6H\",\"custom_field_values\": {\"manufacturer\": \"Dell\",\"model\": \"XPS 15\"},\"name\": \"Laptop 2\",\"status_id\": \"01K9BW8DD6Z2N7TXM313N8BR69\"}]}}""");String userCredentials = "your_email_address" + "/token:" + "your_api_token";String basicAuth = "Basic " + java.util.Base64.getEncoder().encodeToString(userCredentials.getBytes());Request request = new Request.Builder().url(urlBuilder.build()).method("POST", body).addHeader("Content-Type", "application/json").addHeader("Authorization", basicAuth).build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');var data = JSON.stringify({"job": {"action": "create","items": [{"asset_type_id": "01K9BW852KHGF59W0TM02J2F6H","custom_field_values": {"manufacturer": "Apple","model": "MacBookPro18,1"},"name": "Laptop 1","status_id": "01K9BW8DD6Z2N7TXM313N8BR69"},{"asset_type_id": "01K9BW852KHGF59W0TM02J2F6H","custom_field_values": {"manufacturer": "Dell","model": "XPS 15"},"name": "Laptop 2","status_id": "01K9BW8DD6Z2N7TXM313N8BR69"}]}});var config = {method: 'POST',url: 'https://example.zendesk.com/api/v2/it_asset_management/assets/jobs',headers: {'Content-Type': 'application/json','Authorization': 'Basic <auth-value>', // Base64 encoded "{email_address}/token:{api_token}"},data : data,};axios(config).then(function (response) {console.log(JSON.stringify(response.data));}).catch(function (error) {console.log(error);});
Python
import requestsimport jsonfrom requests.auth import HTTPBasicAuthurl = "https://example.zendesk.com/api/v2/it_asset_management/assets/jobs"payload = json.loads("""{"job": {"action": "create","items": [{"asset_type_id": "01K9BW852KHGF59W0TM02J2F6H","custom_field_values": {"manufacturer": "Apple","model": "MacBookPro18,1"},"name": "Laptop 1","status_id": "01K9BW8DD6Z2N7TXM313N8BR69"},{"asset_type_id": "01K9BW852KHGF59W0TM02J2F6H","custom_field_values": {"manufacturer": "Dell","model": "XPS 15"},"name": "Laptop 2","status_id": "01K9BW8DD6Z2N7TXM313N8BR69"}]}}""")headers = {"Content-Type": "application/json",}email_address = 'your_email_address'api_token = 'your_api_token'# Use basic authenticationauth = HTTPBasicAuth(f'{email_address}/token', api_token)response = requests.request("POST",url,auth=auth,headers=headers,json=payload)print(response.text)
Ruby
require "net/http"require "base64"uri = URI("https://example.zendesk.com/api/v2/it_asset_management/assets/jobs")request = Net::HTTP::Post.new(uri, "Content-Type": "application/json")request.body = %q({"job": {"action": "create","items": [{"asset_type_id": "01K9BW852KHGF59W0TM02J2F6H","custom_field_values": {"manufacturer": "Apple","model": "MacBookPro18,1"},"name": "Laptop 1","status_id": "01K9BW8DD6Z2N7TXM313N8BR69"},{"asset_type_id": "01K9BW852KHGF59W0TM02J2F6H","custom_field_values": {"manufacturer": "Dell","model": "XPS 15"},"name": "Laptop 2","status_id": "01K9BW8DD6Z2N7TXM313N8BR69"}]}})email = "your_email_address"api_token = "your_api_token"credentials = "#{email}/token:#{api_token}"encoded_credentials = Base64.strict_encode64(credentials)request["Authorization"] = "Basic #{encoded_credentials}"response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|http.request(request)end
curl - Create multiple assets
For clarity, the example places the JSON in a separate file and imports it into the cURL statement
my_job.json
{"job": {"action": "create","items": [{"name": "Laptop 1","asset_type_id": "01K9BW852KHGF59W0TM02J2F6H","status_id": "01K9BW8DD6Z2N7TXM313N8BR69","custom_field_values": {"manufacturer": "Apple","model": "MacBookPro18,1"}},{"name": "Laptop 2","asset_type_id": "01K9BW852KHGF59W0TM02J2F6H","status_id": "01K9BW8DD6Z2N7TXM313N8BR69","custom_field_values": {"manufacturer": "Dell","model": "XPS 15"}}]}}
curl - Create multiple assets snippet
curl https://{subdomain}.zendesk.com/api/v2/it_asset_management/assets/jobs.json \-d @my_job.json \-H "Content-Type: application/json" -v -u {email_address}/token:{api_token} -X POST
curl - Create multiple assets using names
This example demonstrates using resource names instead of IDs for asset_type, status, and location. For clarity, the example places the JSON in a separate file and imports it into the cURL statement.
my_job.json
{"job": {"action": "create","items": [{"name": "Laptop 3","asset_type": "Laptop","status": "In Use","location": "San Francisco Office","custom_field_values": {"manufacturer": "Lenovo","model": "ThinkPad X1"}}]}}
curl - Create multiple assets using names snippet
curl https://{subdomain}.zendesk.com/api/v2/it_asset_management/assets/jobs.json \-d @my_job.json \-H "Content-Type: application/json" -v -u {email_address}/token:{api_token} -X POST
curl - Update multiple assets
For the update action, each job item must include id attribute. For clarity, the example places the JSON in a separate file and imports it into the cURL statement.
my_job.json
{"job": {"action": "update","items": [{"id": "01K9BW852KHGF59W0TM02J2F6H","name": "Updated Laptop 1","notes": "Updated notes","custom_field_values": {"ip_address": "1.2.3.4"}},{"id": "01K9BW852KHGF59W0TM02J2F6J","name": "Updated Laptop 2","custom_field_values": {"ip_address": "5.6.7.8"}}]}}
curl - Update multiple assets snippet
curl https://{subdomain}.zendesk.com/api/v2/it_asset_management/assets/jobs.json \-d @my_job.json \-H "Content-Type: application/json" -v -u {email_address}/token:{api_token} -X POST
curl - Delete multiple assets by ID
For clarity, the example places the JSON in a separate file and imports it into the cURL statement
my_job.json
{"job": {"action": "delete","items": ["01K9BW852KHGF59W0TM02J2F6H", "01K9BW852KHGF59W0TM02J2F6J", "01K9BW852KHGF59W0TM02J2F6K"]}}
curl - Delete multiple assets by ID snippet
curl https://{subdomain}.zendesk.com/api/v2/it_asset_management/assets/jobs.json \-d @my_job.json \-H "Content-Type: application/json" -v -u {email_address}/token:{api_token} -X POST
curl - Delete multiple assets by External ID
For clarity, the example places the JSON in a separate file and imports it into the cURL statement
my_job.json
{"job": {"action": "delete_by_external_id","items": ["ext-123", "ext-456", "ext-789"]}}
curl - Delete multiple assets by External ID snippet
curl https://{subdomain}.zendesk.com/api/v2/it_asset_management/assets/jobs.json \-d @my_job.json \-H "Content-Type: application/json" -v -u {email_address}/token:{api_token} -X POST
Example response(s)
201 Created
// Status 201 Created{"job_status": {"id": "V3-291e720c98aef4d953563ab090486213","message": null,"progress": null,"results": null,"status": "queued","total": 2,"url": "https://{subdomain}.zendesk.com/api/v2/job_statuses/V3-291e720c98aef4d953563ab090486213.json"}}