Table of Contents


Delete records

Use this REST endpoint to delete records based on the specified record IDs. Specify the record ID and use the DELETE method of the resource to delete a record or a list of records. 

The action performed when deleting a record depends on the entity type. For example, native Magentrix entities are soft-deleted and can be restored from the recycle bin for up to 30 days. Deleting external records (such as Salesforce.com objects) will remove the record from the external system via its API. Please review the relevant data retention policies for any external systems.
 

curl DELETE 'https://{domain}/api/3.0/entity/{entity_name}'
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H 'Authorization: Bearer {access_token}'
-d '{JSON array of IDs}'

The list of record IDs must be of the same entity type, and you can provide up to 200 IDs at a time.

 

You can also call the API to delete a single record like this:

curl DELETE 'https://{domain}/api/3.0/entity/{entity_name}/{record_id}'
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H 'Authorization: Bearer {access_token}'

 

Request

entity_name string Required

Use the entity’s API name in the REST resource path to specify the type of record you want to delete.
 

record_id string Optional
Use this parameter to outline which record should be deleted. Do not include "record_id" if you wish to delete more than one record via body payload.
 

Request Body

JSONdata string Optional

An optional list of record IDs to be deleted. You need to limit the number of IDs to a maximum of 200.

 

Example

curl DELETE 'https://{domain}/api/3.0/entity/account/00100000000001F0001'
 -H 'Content-Type: application/json'
 -H 'Accept: application/json'
 -H 'Authorization: Bearer {access_token}'

 

Successful Response

HTTP 200 OK

{
   "id": "00100000000001F0001",
   "errors": [],
   "success": true
}

If your request payload contains an array of entities, the response will also be an array. Each item (ID) in the response corresponds to its matching record in the original payload, in the same order.


Failed Response

HTTP 406 Not Acceptable

{
    "message": "Resource not found",
    "success": false
}

 

What Is Next?