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 404 Not Found

{
    "message": "Record was not found or you may not have access.",
    "success": false
}

 


Conditional Delete

Single-record DELETE supports the same precondition headers as PATCH (If-Match and If-Unmodified-Since). Use them when you want the delete to fail if the record has changed since you last read it — for example, to avoid deleting a record that another process just updated.

Request HeaderBehaviour
If-MatchThe DELETE proceeds only if the record's current ETag matches the supplied value. If-Match: * accepts any existing record.
If-Unmodified-SinceThe DELETE proceeds only if the record's ModifiedOn is at or before the supplied date.

When a precondition fails, the server returns HTTP 412 Precondition Failed and the record is not deleted. A malformed If-Unmodified-Since returns HTTP 400 Bad Request with error code INVALID_HEADER. For full header semantics and the list of accepted date formats, see Update a Record — Optimistic Concurrency.

Examples

Atomic delete using an ETag from a prior GET

DELETE /api/3.0/entity/account/0010000000000010001 HTTP/1.1
Authorization: Bearer <token>
If-Match: W/"2026-04-17T20:42:11.107Z"

Delete only if no changes since a cutoff

DELETE /api/3.0/entity/account/0010000000000010001 HTTP/1.1
Authorization: Bearer <token>
If-Unmodified-Since: Fri, 17 Apr 2026 20:42:11 GMT

Bulk DELETE and Concurrency

Per-record preconditions do not apply to bulk DELETE. All records in a bulk request are deleted regardless of any request headers sent. If you need optimistic concurrency on a specific record, send a single-record DELETE.


Status Codes

HTTP CodeError CodeTriggered When
200 OKThe record (or records, for bulk) was deleted.
202 AcceptedBulk delete: some records were deleted and some failed. The response body indicates which.
400 Bad RequestINVALID_HEADERIf-Unmodified-Since could not be parsed.
400 Bad RequestMore than 200 IDs were supplied, or no IDs / record_id were provided.
404 Not FoundENTITY_NOT_FOUNDThe record was not found, or you do not have access. See Failed Response above.
406 Not AcceptableThe record could not be deleted (for example, a dependency prevents it), or all records in a bulk request failed.
412 Precondition FailedPRECONDITION_FAILEDIf-Match was supplied and did not match the current ETag — or If-Unmodified-Since was supplied and the record was modified after that date. The record is not deleted.

What Is Next?

Last updated on 7/5/2026

Attachments