cURL
curl --request DELETE \
--url https://letterby.com/api/v4/audiences/{id} \
--header 'apiKey: <api-key>'import requests
url = "https://letterby.com/api/v4/audiences/{id}"
headers = {"apiKey": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {apiKey: '<api-key>'}};
fetch('https://letterby.com/api/v4/audiences/{id}', 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://letterby.com/api/v4/audiences/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"apiKey: <api-key>"
],
]);
$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://letterby.com/api/v4/audiences/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("apiKey", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://letterby.com/api/v4/audiences/{id}")
.header("apiKey", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://letterby.com/api/v4/audiences/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["apiKey"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"audience": {
"id": "<string>",
"name": "<string>",
"filters": "<string>",
"mode": "smart",
"listId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"subs": [
{
"id": "<string>",
"email": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"phoneNumber": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"points": 123,
"referrals": 123,
"listId": "<string>",
"isVerified": true,
"unsubscribed": true,
"data": {},
"address": "<string>",
"isGDPR": true,
"name": "<string>",
"instagram": "<string>",
"twitter": "<string>",
"website": "<string>",
"company": "<string>",
"country": "<string>",
"city": "<string>",
"list": {
"id": "<string>",
"name": "<string>",
"url": "<string>",
"mode": "<string>",
"referrals": true,
"color": "<string>",
"title": "<string>",
"desc": "<string>"
},
"audiences": "<array>",
"referralLink": "<string>",
"privateLink": "<string>"
}
]
}
}
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}Audiences
Delete Audience
Deletes an audience by ID
DELETE
/
audiences
/
{id}
cURL
curl --request DELETE \
--url https://letterby.com/api/v4/audiences/{id} \
--header 'apiKey: <api-key>'import requests
url = "https://letterby.com/api/v4/audiences/{id}"
headers = {"apiKey": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {apiKey: '<api-key>'}};
fetch('https://letterby.com/api/v4/audiences/{id}', 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://letterby.com/api/v4/audiences/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"apiKey: <api-key>"
],
]);
$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://letterby.com/api/v4/audiences/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("apiKey", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://letterby.com/api/v4/audiences/{id}")
.header("apiKey", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://letterby.com/api/v4/audiences/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["apiKey"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"audience": {
"id": "<string>",
"name": "<string>",
"filters": "<string>",
"mode": "smart",
"listId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"subs": [
{
"id": "<string>",
"email": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"phoneNumber": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"points": 123,
"referrals": 123,
"listId": "<string>",
"isVerified": true,
"unsubscribed": true,
"data": {},
"address": "<string>",
"isGDPR": true,
"name": "<string>",
"instagram": "<string>",
"twitter": "<string>",
"website": "<string>",
"company": "<string>",
"country": "<string>",
"city": "<string>",
"list": {
"id": "<string>",
"name": "<string>",
"url": "<string>",
"mode": "<string>",
"referrals": true,
"color": "<string>",
"title": "<string>",
"desc": "<string>"
},
"audiences": "<array>",
"referralLink": "<string>",
"privateLink": "<string>"
}
]
}
}
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}