Skip to main content Skip to complementary content
Close announcements banner

Delete records by query

Deletes one or more records that match the provided query. Query is provided in the request content as JSON.
Request
PUT /services/rest/data/{containerName}/delete

The body is a query language in JSON format. The parameter content type is application/json.

Parameters
  • containerName: This is a String value which specifies the name of the data container from which the data record(s) will be deleted.
  • container: This is a String value which represents the type of the data container. It is either MASTER (default) or STAGING.
  • updateReport: This is a Boolean value which controls whether to generate a journal entry (update report). By default, it is false.
  • logical: This is a Boolean value which controls whether to delete records that match the provided query logically. By default, it is false, which implies that the records will be physically removed from the database and cannot be recovered from the Recycle Bin.
    Information noteNote: Logical delete is only supported on master data records.
Headers
  • Content-Type: application/json
  • Authorization: Basic Authentication scheme
Response No content.
Status
  • 200 OK: The operation is executed successfully, and all records that match the provided query are deleted.
  • 400 BAD REQUEST: The request contains invalid parameter, for example, invalid storage name, invalid storage type, or wrong XML document.
  • 401 UNAUTHORIZED: Login fails, invalid username or password.
  • 403 FORBIDDEN: Missing required permission, for example, no required WRITE permission.
  • 404 NOT FOUND: The resource does not exist, for example, invalid service URL.
  • 500 INTERNAL SERVER ERROR: Other errors.
Limitation This REST API does not support deleting records by query for the Role entity in the PROVISIONING system data container.

Sample request

To delete the Product instances where Product/Price is greater than 18, use the following query:

{
   "select": {	
      "from": ["Product"],
      "where": {
         "gt":[
           {"field": "Product/Price"},
           {"value": "18"}
         ]
      }
   }
}

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!