cURL
curl -X DELETE 'https://api.nuntly.com/contacts/ct_01kabn43yqyxn2bx4ve84mczd3/segments/seg_01kabn43yqyxn2bx4ve84mczd3' \
-H 'Authorization: Bearer apk_xxx'import { Nuntly } from '@nuntly/sdk';
const client = new Nuntly({
apiKey: process.env['NUNTLY_API_KEY'],
});
const response = await client.contacts.segments.removeContactSegmentMembership('ct_01kabn43yqyxn2bx4ve84mczd3', 'seg_01kabn43yqyxn2bx4ve84mczd3');import com.nuntly.sdk.Nuntly;
import com.nuntly.sdk.ClientOptions;
var nuntly = Nuntly.create(ClientOptions.builder()
.apiKey(System.getenv("NUNTLY_API_KEY"))
.build());
var response = nuntly.contacts().segments().removeContactSegmentMembership("ct_01kabn43yqyxn2bx4ve84mczd3", "seg_01kabn43yqyxn2bx4ve84mczd3");import requests
url = "https://api.nuntly.com/contacts/{contactId}/segments/{segmentId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nuntly.com/contacts/{contactId}/segments/{segmentId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.nuntly.com/contacts/{contactId}/segments/{segmentId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.nuntly.com/contacts/{contactId}/segments/{segmentId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "ct_01kabn43yqyxn2bx4ve84mczd3",
"segmentId": "seg_01kabn43yqyxn2bx4ve84mczd3"
}
}{
"error": {
"status": 123,
"code": "<string>",
"title": "<string>",
"details": {}
}
}Segment memberships
Remove Contact Segment Membership
Remove a contact from a segment.
DELETE
/
contacts
/
{contactId}
/
segments
/
{segmentId}
cURL
curl -X DELETE 'https://api.nuntly.com/contacts/ct_01kabn43yqyxn2bx4ve84mczd3/segments/seg_01kabn43yqyxn2bx4ve84mczd3' \
-H 'Authorization: Bearer apk_xxx'import { Nuntly } from '@nuntly/sdk';
const client = new Nuntly({
apiKey: process.env['NUNTLY_API_KEY'],
});
const response = await client.contacts.segments.removeContactSegmentMembership('ct_01kabn43yqyxn2bx4ve84mczd3', 'seg_01kabn43yqyxn2bx4ve84mczd3');import com.nuntly.sdk.Nuntly;
import com.nuntly.sdk.ClientOptions;
var nuntly = Nuntly.create(ClientOptions.builder()
.apiKey(System.getenv("NUNTLY_API_KEY"))
.build());
var response = nuntly.contacts().segments().removeContactSegmentMembership("ct_01kabn43yqyxn2bx4ve84mczd3", "seg_01kabn43yqyxn2bx4ve84mczd3");import requests
url = "https://api.nuntly.com/contacts/{contactId}/segments/{segmentId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nuntly.com/contacts/{contactId}/segments/{segmentId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.nuntly.com/contacts/{contactId}/segments/{segmentId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.nuntly.com/contacts/{contactId}/segments/{segmentId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "ct_01kabn43yqyxn2bx4ve84mczd3",
"segmentId": "seg_01kabn43yqyxn2bx4ve84mczd3"
}
}{
"error": {
"status": 123,
"code": "<string>",
"title": "<string>",
"details": {}
}
}Authorizations
Use an API key from https://nuntly.com/api-keys. Required on every endpoint.
Path Parameters
The id of the segment the contact was removed from. The segment itself is not deleted.
Response
Successful response.
Show child attributes
Show child attributes
