Clear Data from a Data Extension

Perform the ClearData action on a data extension to delete all of its data without deleting the data extension. This feature is available only to administrative users in an Enterprise 2.0 account.

If a data extension is shared across multiple business units, only the owner of the data extension can clear the data from it. The authentication credentials that you use to perform a request to delete data from a shared data extension must be associated with the user who owns the data extension.

Note

1<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
2  xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing"
3  xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
4  <s:Header>
5    <a:Action s:mustUnderstand="1">Perform</a:Action>
6    <a:To s:mustUnderstand="1">
7      https://YOUR_SUBDOMAIN.soap.marketingcloudapis.com/Service.asmx</a:To>
8    <fueloauth xmlns="http://exacttarget.com">YOUR_ACCESS_TOKEN</fueloauth>
9  </s:Header>
10  <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
11    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
12    <PerformRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI"
13      xmlns:ns2="urn:fault.partner.exacttarget.com">
14      <Action>ClearData</Action>
15      <Definitions>
16        <Definition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
17          xsi:type="DataExtension">
18          <CustomerKey>YOUR_DATA_EXTENSION_KEY</CustomerKey>
19        </Definition>
20      </Definitions>
21    </PerformRequestMsg>
22  </s:Body>
23</s:Envelope>

A successful request confirms that all of the data in the specified data extension was deleted.

1<?xml version="1.0" encoding="utf-8"?>
2<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
3  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
5  xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
6  xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
7  xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
8  <env:Header xmlns:env="http://www.w3.org/2003/05/soap-envelope">
9    <wsa:Action>PerformResponse</wsa:Action>
10    <wsa:MessageID>urn:uuid:9c5a77a7-3fa0-4c05-8808-0fb427297fae</wsa:MessageID>
11    <wsa:RelatesTo>urn:uuid:882385ed-0125-4c08-bbd0-2fabe363a2fe</wsa:RelatesTo>
12    <wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous
13    </wsa:To>
14    <wsse:Security>
15      <wsu:Timestamp wsu:Id="Timestamp-081e28eb-1e51-4845-81d0-1b0479d39d3e">
16        <wsu:Created>2024-08-05T12:20:42Z</wsu:Created>
17        <wsu:Expires>2024-08-05T12:25:42Z</wsu:Expires>
18      </wsu:Timestamp>
19    </wsse:Security>
20  </env:Header>
21  <soap:Body>
22    <PerformResponseMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
23      <Results>
24        <Result>
25          <StatusCode>OK</StatusCode>
26          <StatusMessage>Data from requested data extension was cleared
27            successfully. DataExtension - CustomerKey
28            :301a8eb0-6714-4268-b4e0-70cfe963692c
29          </StatusMessage>
30          <Object xsi:type="DataExtension">
31            <PartnerKey xsi:nil="true" />
32            <ObjectID xsi:nil="true" />
33            <CustomerKey>301a8eb0-6714-4268-b4e0-70cfe963692c</CustomerKey>
34          </Object>
35        </Result>
36      </Results>
37      <OverallStatus>OK</OverallStatus>
38      <OverallStatusMessage />
39      <RequestID>d20791fc-f8ca-461a-8d5d-fcdda02d9cf2</RequestID>
40    </PerformResponseMsg>
41  </soap:Body>
42</soap:Envelope>