Skip to navigation

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:

  1. Find the knowledge stores whose items use the asset: Call the GET method of the /knowledge-stores endpoint with the asset_id parameter set to the identifier of the asset.
  2. List the items that use the asset: Call the GET method of the /knowledge-stores/{knowledge_store_id}/items endpoint for each knowledge store that step 1 returns. Set the asset_id parameter to the identifier of the asset.
  3. Delete the items: Delete each item with the DELETE method of the /knowledge-stores/{knowledge_store_id}/items/{item_id} endpoint.
  4. Delete the asset: Retry the delete request. If the delete fails with the asset_has_linked_resources error 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:

  1. (Optional) List the indexed assets: To see which indexed assets the delete removes, call the GET method of the /assets/{asset_id}/indexed-assets endpoint.
  2. Delete the asset and its indexed assets: Retry the delete request with the force query parameter set to true.

Authentication

x-api-keystring

Your API key.

Note

You can find your API key on the API Keys page.

Path parameters

asset_idstringRequired
The unique identifier of the asset to delete.

Query parameters

forcebooleanOptionalDefaults to false

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.
  • false or omitted: Fails with 409 Conflict if 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.

Errors

400
Bad Request Error
404
Not Found Error
409
Conflict Error