Delete an asset
This method deletes the specified asset. This action cannot be undone.
A successful delete also removes the asset from each entity that uses it. To list these entities first, use the GET method of the /assets/{asset_id}/entities endpoint.
The delete fails with a 409 Conflict error when other resources depend on the asset.
If the error code is asset_has_knowledge_store_items, knowledge store items use the asset. The request fails even when you set the force query parameter to true. To delete the asset:
- Find the knowledge stores whose items use the asset: Call the
GETmethod of the/knowledge-storesendpoint with theasset_idparameter set to the identifier of the asset. - List the items that use the asset: Call the
GETmethod of the/knowledge-stores/{knowledge_store_id}/itemsendpoint for each knowledge store that step 1 returns. Set theasset_idparameter to the identifier of the asset. - Delete the items: Delete each item with the
DELETEmethod of the/knowledge-stores/{knowledge_store_id}/items/{item_id}endpoint. - Delete the asset: Retry the delete request. If the delete fails with the
asset_has_linked_resourceserror code, follow the steps in the next case.
If the error code is asset_has_linked_resources, indexed assets reference the asset. A delete with the force query parameter set to true also deletes these indexed assets. To delete both:
- (Optional) List the indexed assets: To see which indexed assets the delete removes, call the
GETmethod of the/assets/{asset_id}/indexed-assetsendpoint. - Delete the asset and its indexed assets: Retry the delete request with the
forcequery parameter set totrue.
Authentication
Your API key.
You can find your API key on the API Keys page.
Path parameters
Query parameters
Use this parameter to choose how the delete handles indexed assets that reference the asset:
true: Deletes the asset and the indexed assets that reference it.falseor omitted: Fails with409 Conflictif indexed assets reference the asset.
If knowledge store items use the asset, the request fails with 409 Conflict for either value. Delete the items first.
Default: false.