Excluding Data Extensions
To exclude a data extension from an email send, you need to specify the data extension in the exclusion list within your SOAP request. Here’s an example of how to structure your SOAP request to include an exclusion:
xml
<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">Create</a:Action>
<a:To s:mustUnderstand="1">https://{{Subdomain}}.soap.marketingcloudapis.com/Service.asmx</a:To>
{{auth token}}
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CreateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
<Objects xsi:type="EmailSendDefinition">
<CustomerKey>esd_cust_key</CustomerKey>
<Name>ESD Name</Name>
<Description>ESD Description</Description>
<SendClassification>
<CustomerKey>Default Commercial</CustomerKey>
</SendClassification>
<ExclusionFilter>
<FilterDefinition>
<DataSource>
<CustomerKey>ExcludeDE</CustomerKey>
</DataSource>
<FilterPart>
<SimpleFilterPart>
<Property>EmailAddress</Property>
<SimpleOperator>equals</SimpleOperator>
<Value>[email protected]</Value>
</SimpleFilterPart>
</FilterPart>
</FilterDefinition>
</ExclusionFilter>
</Objects>
</CreateRequest>
</s:Body>
</s:Envelope>
In this example, replace ExcludeDE with the CustomerKey of the data extension you want to exclude.
To select multiple data extensions for sending the campaign, you need to include each data extension in the SendDefinitionList within your SOAP request. Here’s an example:
xml
<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">Create</a:Action>
<a:To s:mustUnderstand="1">https://{{Subdomain}}.soap.marketingcloudapis.com/Service.asmx</a:To>
{{auth token}}
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CreateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
<Objects xsi:type="EmailSendDefinition">
<CustomerKey>esd_cust_key</CustomerKey>
<Name>ESD Name</Name>
<Description>ESD Description</Description>
<SendClassification>
<CustomerKey>Default Commercial</CustomerKey>
</SendClassification>
<SendDefinitionList>
<SendDefinitionListType>SourceList</SendDefinitionListType>
<CustomerKey>DataExtension1</CustomerKey>
</SendDefinitionList>
<SendDefinitionList>
<SendDefinitionListType>SourceList</SendDefinitionListType>
<CustomerKey>DataExtension2</CustomerKey>
</SendDefinitionList>
</Objects>
</CreateRequest>
</s:Body>
</s:Envelope>
In this example, replace DataExtension1 and DataExtension2 with the CustomerKeys of the data extensions you want to include in the send.