Update audience
curl --request POST \
--url https://dev.tryunleashx.com/api/v1/global/audience/update \
--header 'Content-Type: application/json' \
--header 'token: <token>' \
--data '
{
"audience_id": 123,
"audience_name": "<string>",
"description": "<string>"
}
'import requests
url = "https://dev.tryunleashx.com/api/v1/global/audience/update"
payload = {
"audience_id": 123,
"audience_name": "<string>",
"description": "<string>"
}
headers = {
"token": "<token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {token: '<token>', 'Content-Type': 'application/json'},
body: JSON.stringify({audience_id: 123, audience_name: '<string>', description: '<string>'})
};
fetch('https://dev.tryunleashx.com/api/v1/global/audience/update', 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://dev.tryunleashx.com/api/v1/global/audience/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'audience_id' => 123,
'audience_name' => '<string>',
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"token: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://dev.tryunleashx.com/api/v1/global/audience/update"
payload := strings.NewReader("{\n \"audience_id\": 123,\n \"audience_name\": \"<string>\",\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("token", "<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.post("https://dev.tryunleashx.com/api/v1/global/audience/update")
.header("token", "<token>")
.header("Content-Type", "application/json")
.body("{\n \"audience_id\": 123,\n \"audience_name\": \"<string>\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.tryunleashx.com/api/v1/global/audience/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["token"] = '<token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"audience_id\": 123,\n \"audience_name\": \"<string>\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"data": {
"id": 123
}
}Audience
Update Audience
Rename or describe an existing audience, or soft-delete it by passing status: 2.
POST
/
audience
/
update
Update audience
curl --request POST \
--url https://dev.tryunleashx.com/api/v1/global/audience/update \
--header 'Content-Type: application/json' \
--header 'token: <token>' \
--data '
{
"audience_id": 123,
"audience_name": "<string>",
"description": "<string>"
}
'import requests
url = "https://dev.tryunleashx.com/api/v1/global/audience/update"
payload = {
"audience_id": 123,
"audience_name": "<string>",
"description": "<string>"
}
headers = {
"token": "<token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {token: '<token>', 'Content-Type': 'application/json'},
body: JSON.stringify({audience_id: 123, audience_name: '<string>', description: '<string>'})
};
fetch('https://dev.tryunleashx.com/api/v1/global/audience/update', 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://dev.tryunleashx.com/api/v1/global/audience/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'audience_id' => 123,
'audience_name' => '<string>',
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"token: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://dev.tryunleashx.com/api/v1/global/audience/update"
payload := strings.NewReader("{\n \"audience_id\": 123,\n \"audience_name\": \"<string>\",\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("token", "<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.post("https://dev.tryunleashx.com/api/v1/global/audience/update")
.header("token", "<token>")
.header("Content-Type", "application/json")
.body("{\n \"audience_id\": 123,\n \"audience_name\": \"<string>\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.tryunleashx.com/api/v1/global/audience/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["token"] = '<token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"audience_id\": 123,\n \"audience_name\": \"<string>\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"data": {
"id": 123
}
}Use this endpoint to rename or describe an existing audience, or soft-delete it.
When
Endpoint
POST/audience/update
Content-Type: application/json
Authentication: Required (workspace auth)
Request Body
Rename / describe
{
"audience_id": 55,
"audience_name": "VIP Customers 2026",
"description": "Updated description"
}
Soft-delete
{
"audience_id": 55,
"status": 2
}
| Field | Type | Required | Description |
|---|---|---|---|
audience_id | number | Yes | ID of the audience to update |
audience_name | string | No | New name. Must be unique within the workspace. Ignored when status is 2. |
description | string | No | New description |
status | number | No | Set to 2 to soft-delete the audience. See Audience Status Codes. |
Audience Status Codes
| Code | Status |
|---|---|
0 | Inactive |
1 | Active |
2 | Deleted |
Response
{
"message": "Audience updated successfully",
"data": { "id": 55 }
}
status: 2 is passed:
{
"message": "Audience deleted successfully",
"data": { "id": 55 }
}
Error Cases
| Error | Cause |
|---|---|
Audience Id is missing. | audience_id not provided |
Audience not found | audience_id doesn’t belong to the caller’s company/workspace, or is already deleted |
Audience name already exists in this workspace | audience_name clashes with another (non-deleted) audience in the workspace |
Example cURL
curl -X POST https://www.tryunleashx.com/api/v1/global/audience/update \
-H "Content-Type: application/json" \
-H "token: <api_key>" \
-d '{
"audience_id": 55,
"audience_name": "VIP Customers 2026"
}'
Headers
API token for authentication
Body
application/json
Was this page helpful?
⌘I

