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.

note: 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.

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
  xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing"
  xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
  <s:Header>
    <a:Action s:mustUnderstand="1">Perform</a:Action>
    <a:To s:mustUnderstand="1">
      https://YOUR_SUBDOMAIN.soap.marketingcloudapis.com/Service.asmx</a:To>
    <fueloauth xmlns="http://exacttarget.com">YOUR_ACCESS_TOKEN</fueloauth>
  </s:Header>
  <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <PerformRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI"
      xmlns:ns2="urn:fault.partner.exacttarget.com">
      <Action>ClearData</Action>
      <Definitions>
        <Definition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:type="DataExtension">
          <CustomerKey>YOUR_DATA_EXTENSION_KEY</CustomerKey>
        </Definition>
      </Definitions>
    </PerformRequestMsg>
  </s:Body>
</s:Envelope>

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

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