---
schema_version: "1"
id: f7cc2638acfb091064cee2752ca25cf1fc6b988c0465326cf28ec61156faea80
title: Delete via WSProxy
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/guides/mc-programmatic-content/ssjs_WSProxy_delete.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_WSProxy_delete.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 61034695623d356ae872d296c2832971ee55dd7d0a4f6d2e935d3e7c89544707
products:
  - Marketing Cloud Engagement APIs and Programmatic Languages
  - Marketing Cloud
---
# Delete via WSProxy

To delete a single item or several items of the same type in a single call, use the `deleteItem()` and `deleteBatch()` functions.

- Specify the first two parameters of the delete functions like you do for the create functions.
- The optional third parameter includes any properties to be set using the SOAP `DeleteOptions` object.

## Example: Delete a Data Extension

This example deletes a data extension using its object ID.

```js
var prox = new Script.Util.WSProxy();
var objectID = "c9875a80-4dad-e411-b071-ac7ba13db5bc";

var res = prox.deleteItem("DataExtension", { ObjectID: objectID });
```

**important:** You can’t delete a data extension if it has a data relationship to contact records or to another data extension. To delete a data extension that has a data relationship, first use Data Designer to remove the relationship, and then delete the data extension. See [Data Designer](https://help.salesforce.com/s/articleView?id=mktg.mc_cab_data_designer.htm) in Salesforce Help.

The returned object has the same properties as the Create functions, except the results contain properties from the SOAP `DeleteResult` items.

## See Also

- [Create via WSProxy](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_WSProxy_create.md)
