Create a free account

API Documentation

MailBuild

Subscriber.Unsubscribe

Changes the status of an Active Subscriber to an Unsubscribed Subscriber who will no longer receive campaigns sent to that Subscriber List.

Arguments

The parameters you need to pass in are:

ApiKey (Required)
Your API application key. See here for more details.
ListID (Required)
The list you want to unsubscribe from. See here for more details.
Email (Required)
The email address of the subscriber to be removed.

SOAP

The following is a sample SOAP request to remove a subscriber. The placeholders shown need to be replaced with actual values.

POST http://yoursitename.createsend.com/api/api.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://api.createsend.com/api/Subscriber.Unsubscribe"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
 xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <Subscriber.Unsubscribe xmlns="http://api.createsend.com/api/">
      <ApiKey>string</ApiKey>
      <ListID>string</ListID>
      <Email>string</Email>
    </Subscriber.Unsubscribe>
  </soap:Body>
</soap:Envelope>

Here is the response you will receive.

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
 xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <Subscriber.UnsubscribeResponse xmlns="http://api.createsend.com/api/">
      <Subscriber.UnsubscribeResult>
        <Code>int</Code>
        <Message>string</Message>
      </Subscriber.UnsubscribeResult>
    </Subscriber.UnsubscribeResponse>
  </soap:Body>
</soap:Envelope>

Error Codes

1: Invalid email address
The email value passed in was an invalid email address.
100: Invalid API Key
The API key passed was not valid or has expired.
101: Invalid ListID
The ListID value passed in was not valid.