Delete attributes
Deletes one or more asset attributes by ID, with an optional force delete for attributes linked to assets.
Prerequisites
- Authentication and setup: A valid access token.
- Create attributes: The attributes must exist.
Endpoint
Section titled “Endpoint”DELETE /api/assethub/v2/attribute_categories/attributesBase URL: the standard REST host for your region. See Base URLs.
Headers: Authorization: Bearer ACCESS_TOKEN, Content-Type: application/json.
Request
Section titled “Request”| Parameter | Type | Required | Description |
|---|---|---|---|
attribute_ids |
string[] | Required | List of attribute IDs to delete. Maximum 100 attributes per request. Must not contain duplicates. |
force_delete |
boolean | Optional | Whether to remove attributes even if they are linked to assets. true deletes the attribute and removes it from all linked assets. false fails to delete an attribute that is linked to any asset. Default: false. |
user_id |
string | Required | User ID of the user performing the operation, used as the authorizer. |
Request example
Section titled “Request example”{ "attribute_ids": ["123456789012345101", "123456789012345102", "123456789012345103"], "force_delete": false, "user_id": "123456789abcd104"}Response
Section titled “Response”| Field | Type | Description |
|---|---|---|
request_id |
string | Unique ID for the request. |
deleted_attribute_ids |
string[] | List of attribute IDs that were successfully deleted. |
failed |
array | List of attributes that could not be deleted. Each object contains attribute_id and reason. |
Response example
Section titled “Response example”{ "request_id": "req_101", "deleted_attribute_ids": ["123456789012345101", "123456789012345103"], "failed": [ { "attribute_id": "123456789012345102", "reason": "Attribute is currently linked with assets. Use force_delete=true to delete such attributes." } ]}- Limits: Maximum 100 attributes per request.
- Partial success: The response is HTTP 200 even if some attributes fail to delete. Check the
failedlist in the response to identify any issues. - Validation: Duplicate entries in
attribute_idsare handled by deleting the first occurrence. Subsequent duplicates are reported in thefailedlist. - Validation: If
force_deleteisfalse, attributes linked to assets fail with the reason “Attribute is currently linked with assets.”