Remove contacts from the audience
SDK platic.campaigns.audience.remove()
SDK platic.campaigns.audience.removeMany()
Remove contacts whose phoneNumber matches the supplied phone number from the audience.
Example
# Remove one
curl -X DELETE https://api.platic.ai/v1/campaigns/$CAMPAIGN_ID/audience/5215512345678 \
-H "Authorization: Bearer $PLATIC_API_KEY"
# Remove several
curl https://api.platic.ai/v1/campaigns/$CAMPAIGN_ID/audience/remove \
-H "Authorization: Bearer $PLATIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "phoneNumbers": ["5215512345678"] }' // Remove one
await platic.campaigns.audience.remove("campaign_123", "5215512345678");
// Remove several
const result = await platic.campaigns.audience.removeMany("campaign_123", { phoneNumbers: ["5215512345678"] }); Path parameters
| Parameter | Type | Description | Requirement |
|---|---|---|---|
campaignId | string | Unique identifier of the campaign | required |
phoneNumber | string | Phone number of the contact to remove, with country code and without symbols | required |
Response 200 OK
{
"status": "success",
"message": "Client removed from campaign successfully",
"data": {
"success": true,
"message": "Client removed from campaign successfully",
"removedCount": 1
}
} Notes
- The contact stays in the workspace; only the campaign tag is removed.
- If no contact exists with that
phoneNumber, the endpoint answers200withremovedCount: 0 - If several contacts have the same
phoneNumber, the campaign tag is removed from all of them
Remove several at once
Remove from the audience all the results of a contact search, a list of ids, or a list of phones. The contacts stay in the workspace.
{ "phoneNumbers": ["5215512345678", "5215587654321"] } Send exactly one of these:
| Parameter | Type | Description |
|---|---|---|
searchId | string | The searchId of a search: removes all its results. With topN, only the first N |
clientIds | string[] | Contact ids, up to 5,000 |
phoneNumbers | string[] | Phones with country code, up to 5,000 |
{
"status": "success",
"message": "2 contacts were removed from the audience",
"data": {
"target": "phones",
"message": "2 contacts were removed from the audience",
"removed": 2
}
} target is search, client_ids, or phones. removed, notFound, and invalidPhoneCount arrive when Platica reports them.