Remove contacts from a segment
curl --request DELETE \
--url https://api.watx.in/v1/segments/{id}/contacts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contact_ids": [
"7e2d9c01-55b4-4a3d-9c8e-0f1a2b3c4d5e"
]
}
'import requests
url = "https://api.watx.in/v1/segments/{id}/contacts"
payload = { "contact_ids": ["7e2d9c01-55b4-4a3d-9c8e-0f1a2b3c4d5e"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({contact_ids: ['7e2d9c01-55b4-4a3d-9c8e-0f1a2b3c4d5e']})
};
fetch('https://api.watx.in/v1/segments/{id}/contacts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.watx.in/v1/segments/{id}/contacts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'contact_ids' => [
'7e2d9c01-55b4-4a3d-9c8e-0f1a2b3c4d5e'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.watx.in/v1/segments/{id}/contacts"
payload := strings.NewReader("{\n \"contact_ids\": [\n \"7e2d9c01-55b4-4a3d-9c8e-0f1a2b3c4d5e\"\n ]\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.watx.in/v1/segments/{id}/contacts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contact_ids\": [\n \"7e2d9c01-55b4-4a3d-9c8e-0f1a2b3c4d5e\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.watx.in/v1/segments/{id}/contacts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contact_ids\": [\n \"7e2d9c01-55b4-4a3d-9c8e-0f1a2b3c4d5e\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"segment_id": "8c1d2e3f-4a5b-4c6d-8e9f-0a1b2c3d4e5f",
"requested": 1,
"removed": 1
}
}{
"error": {
"code": "bad_request",
"message": "contact_ids is required"
}
}{
"error": {
"code": "unauthorized",
"message": "Missing or invalid API key"
}
}{
"error": {
"code": "forbidden",
"message": "This API key is missing the 'messages:send' scope"
}
}{
"error": {
"code": "not_found",
"message": "Contact not found"
}
}{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded for this API key"
}
}Segments
Remove contacts from a segment
Removes contacts from a static segment. The contact ids go in the
request body, as they do when adding. removed counts the rows
actually deleted.
Requires the contacts:write scope.
DELETE
/
segments
/
{id}
/
contacts
Remove contacts from a segment
curl --request DELETE \
--url https://api.watx.in/v1/segments/{id}/contacts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contact_ids": [
"7e2d9c01-55b4-4a3d-9c8e-0f1a2b3c4d5e"
]
}
'import requests
url = "https://api.watx.in/v1/segments/{id}/contacts"
payload = { "contact_ids": ["7e2d9c01-55b4-4a3d-9c8e-0f1a2b3c4d5e"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({contact_ids: ['7e2d9c01-55b4-4a3d-9c8e-0f1a2b3c4d5e']})
};
fetch('https://api.watx.in/v1/segments/{id}/contacts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.watx.in/v1/segments/{id}/contacts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'contact_ids' => [
'7e2d9c01-55b4-4a3d-9c8e-0f1a2b3c4d5e'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.watx.in/v1/segments/{id}/contacts"
payload := strings.NewReader("{\n \"contact_ids\": [\n \"7e2d9c01-55b4-4a3d-9c8e-0f1a2b3c4d5e\"\n ]\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.watx.in/v1/segments/{id}/contacts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contact_ids\": [\n \"7e2d9c01-55b4-4a3d-9c8e-0f1a2b3c4d5e\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.watx.in/v1/segments/{id}/contacts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contact_ids\": [\n \"7e2d9c01-55b4-4a3d-9c8e-0f1a2b3c4d5e\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"segment_id": "8c1d2e3f-4a5b-4c6d-8e9f-0a1b2c3d4e5f",
"requested": 1,
"removed": 1
}
}{
"error": {
"code": "bad_request",
"message": "contact_ids is required"
}
}{
"error": {
"code": "unauthorized",
"message": "Missing or invalid API key"
}
}{
"error": {
"code": "forbidden",
"message": "This API key is missing the 'messages:send' scope"
}
}{
"error": {
"code": "not_found",
"message": "Contact not found"
}
}{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded for this API key"
}
}Authorizations
Your workspace API key, created in Settings → API keys, sent as
Authorization: Bearer <key>. New keys start with watx_live_; keys
issued before the rename start with converse360_live_ and still work.
Path Parameters
The segment id.
Body
application/json
Required array length:
1 - 1000 elementsResponse
How many memberships were removed.
Show child attributes
Show child attributes