Deleting entities

You can delete entities by sending a REST API DELETE request to the server.

About this task

A DELETE request removes entities from the server. You can delete all the entities of a specified type, or delete a single entity by providing the entity ID in the request. If you add the all-types parameter to the delete request, you can remove all the entities in a solution.

Procedure

  1. Make sure you can access the Insight Server by entering the generic REST URL in the browser address field. See Managing entities for an example of the REST URL.
  2. Create the DELETE request by using the syntax that is shown in the example.

    Depending on the value of the httpEndpoint setting in the server.xml file on your system, the first part of the request URL is http://hostname:9080 for http connections, or https://hostname:9443 for secure https connections.

    To delete a single, specific entity, include the entity ID in the request. For example:
    .../solutions/solution_name/entity-types/entity_type/entities/entity_id
    where solution_name is the symbolic solution name, for example BankingSolution, and entity_type is a category of entity such as person or customer.
    To delete all entities of a specific type from the solution, do not include an entity ID in the request.
    .../solutions/solution_name/entity-types/entity_type/entities
  3. To remove all entities in a solution, include the all-types parameter in the request. For example:
    .../solutions/solution_name/entity-types?all-types=true
  4. Add the ETag header to the DELETE request to avoid deleting entities that are currently being updated as a result of event processing. The If-Match ETag header enables optimistic updating or deleting of entities. See Updating and retrieving entities by using ETag.

Results

The response to a successful DELETE request includes the status code 200 OK. If the deletion is not successful, the status code 409 Conflict appears in the response. The deletion might fail if the entity does not exist, or if the information specified in the ETag header does not match the current entity version.