News! SmartSender.io becomes Wooxy. Read a post from the CEO Arrow
Wooxy API v.3.0

Remove Contact

The Remove Contact method allows you to remove a contact from a specific list using one of three unique identifiers (email | phoneNumber | userId).

Request

POST
/v3/contacts/remove

IMPORTANT: Do not send more than 10 concurrent API requests.

Body Example

                                        {
   "contactListId": "YOUR_CONTACT_LIST_ID",
   "webHookUri": "YOUR_WEBHOOK_URL",
   "emails": [
      "user-1@example.com",
      "user-2@example.com",
      "user-3@example.com"
   ],
   "phoneNumbers": [
      "+155555555",
      "+155555556"
   ],
   "userIds": [
      "myUserId-1",
      "myUserId-2"
   ]
}
                                    

Parameters

Title Type Default Description

contactListId

required
string

ID of the email list from which the contact should be removed.  
The list should be already created in your account on the Lists page:  
https://app.wooxy.com/email-list

webHookUri

optional
string

The Wooxy will send a POST request to your webHookUri with the status of the request as soon as it is processed.

emails

optional
array null

An array of email addresses of contacts to be removed.
You can remove more than one contact at once:

  • [email]: Contact’s email address.
    WARNING:Minimum one unique user identificator (userId | email | phoneNumber ) is required.

phoneNumbers

optional
array null

An array of phone numbers of contacts to be removed.
You can remove more than one contact at once:

  • [phoneNumber]: Contact’s phone number.
    IMPORTANT: should be valid E.164 phone number.
    WARNINGMinimum one unique user identificator (userId | email | phoneNumber ) is required.

userIds

optional
array null

An array of userIds of contacts to be removed.
You can remove more than one contact at once:

  • [userId]: Contact’s unique user ID from your platform to enable management of the contact in the list based on it.
    WARNING:Minimum one unique user identificator (userId | email | phoneNumber ) is required.

Response

                                        {
  "result": true,
  "requestId": "5d915c22d132d5f45a4e38b8"
}
                                    

Parameters

Title Type Description

result

boolean

The value indicates that the “Remove contact” request was successfully validated and accepted by Wooxy and queued for processing:

  • true: Contact was successfully removed.

requestId

string

Unique request ID to be used to match the specific “Remove contact” request with the Status Webhook, which will be sent by Wooxy after the request is processed.

Method Errors

                                        {
   "result": false,
   "requestId": "5bc0a73d19b6051f963023c3",
   "errors": [
      "Error description text"
   ]
}
                                    
Error

“Maximum count of records per transaction is 100, current {n}”

“Argument contactListId must be a non-empty string”

“Argument webHookUri must be a valid URI”

“Argument emails must be a list of emails”

“Each email must be a string”

“Argument phoneNumbers must be a list of phoneNumbers”

“Each phoneNumber must be a string”

“Argument userIds must be a list of userIds”

“Each userId must be a string”

“List with id {contactListId} not found!”

“add at least one contact to remove”

“Request saving error. Please, contact us or try again later”

“Invalid authorization token!”

“Internal server error”

“Bad Request”

“no matches found for access token {accessToken}”

“user {id} not enabled”

“no data found for key {userId}”

“access token check failed for key\/secret $key\/$accessToken”

“Argument {argument} required”

Code Examples

PHP
                $accessToken = "YOUR_API_KEY";
$url = 'https://api.wooxy.com/v3/contacts/remove';

$body = json_encode([
   'contactListId' => 'YOUR_CONTACT_LIST_ID',
   'webHookUri'    => 'YOUR_WEBHOOK_URL',
   'emails' => [
       'user-1@example.com',
       'user-2@example.com',
       'user-3@example.com'
   ],
   'phoneNumbers' => [
       '+155555555',
       '+155555556'
   ],
   'userIds' => [
       'myUserId-1',
       'myUserId-2'
   ],
]);

/**
* Request Example
*/
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
//curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_INFILESIZE, null);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Access-Token: $accessToken",
'Content-Type: application/json',
'Content-Length: ' . strlen($body),
]);

$result = curl_exec($ch);
if ($result === false) {
   echo 'cURL error:' . curl_error($ch) . PHP_EOL;
} else {
   echo strval($result) . PHP_EOL;
}
curl_close($ch);