Delete Records Using REST API

You can delete individual records using the delete sObject rows endpoints in REST API.

You can use REST API to delete many record types. This table shows the record types that are most relevant to Marketing Cloud.

Record TypeAPI Name
Contact recordsContact
Lead recordsLead
CampaignsCampaign
Marketing segmentsMarketSegment
FlowsFlowRecord

Before you send a request to REST API, obtain a bearer token. For more information, see Connect to REST-based APIs.

To delete a record, send a DELETE request to the /data/v60.0/sobjects/OBJECT_API_NAME/RECORD_ID endpoint. Replace OBJECT_API_NAME with the API name of the type of object that you want to delete, and replace RECORD_ID with the unique ID of the record to delete. You can find the IDs for the records that you want to delete by running a query.

This example shows how to delete a Marketing segment. The DELETE operation doesn’t contain a request body.

If the record is deleted successfully, the API returns a 204 No Content response with no response body.