curl --request POST \
--url https://api.peec.ai/customer/v1/brand-perception/attribute-clusters/edit \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"project_id": "or_f45b94ba-5e35-4982-93ed-285e72ee14eb",
"renames": [
{
"cluster_id": "0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42",
"name": "Racing Heritage"
}
],
"delete_cluster_ids": [
"0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42"
],
"reassignments": [
{
"attribute": "hand-built",
"cluster_id": "0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42"
}
]
}
'import requests
url = "https://api.peec.ai/customer/v1/brand-perception/attribute-clusters/edit"
payload = {
"project_id": "or_f45b94ba-5e35-4982-93ed-285e72ee14eb",
"renames": [
{
"cluster_id": "0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42",
"name": "Racing Heritage"
}
],
"delete_cluster_ids": ["0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42"],
"reassignments": [
{
"attribute": "hand-built",
"cluster_id": "0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42"
}
]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
project_id: 'or_f45b94ba-5e35-4982-93ed-285e72ee14eb',
renames: [{cluster_id: '0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42', name: 'Racing Heritage'}],
delete_cluster_ids: ['0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42'],
reassignments: [{attribute: 'hand-built', cluster_id: '0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42'}]
})
};
fetch('https://api.peec.ai/customer/v1/brand-perception/attribute-clusters/edit', 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.peec.ai/customer/v1/brand-perception/attribute-clusters/edit",
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([
'project_id' => 'or_f45b94ba-5e35-4982-93ed-285e72ee14eb',
'renames' => [
[
'cluster_id' => '0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42',
'name' => 'Racing Heritage'
]
],
'delete_cluster_ids' => [
'0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42'
],
'reassignments' => [
[
'attribute' => 'hand-built',
'cluster_id' => '0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.peec.ai/customer/v1/brand-perception/attribute-clusters/edit"
payload := strings.NewReader("{\n \"project_id\": \"or_f45b94ba-5e35-4982-93ed-285e72ee14eb\",\n \"renames\": [\n {\n \"cluster_id\": \"0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42\",\n \"name\": \"Racing Heritage\"\n }\n ],\n \"delete_cluster_ids\": [\n \"0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42\"\n ],\n \"reassignments\": [\n {\n \"attribute\": \"hand-built\",\n \"cluster_id\": \"0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://api.peec.ai/customer/v1/brand-perception/attribute-clusters/edit")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"project_id\": \"or_f45b94ba-5e35-4982-93ed-285e72ee14eb\",\n \"renames\": [\n {\n \"cluster_id\": \"0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42\",\n \"name\": \"Racing Heritage\"\n }\n ],\n \"delete_cluster_ids\": [\n \"0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42\"\n ],\n \"reassignments\": [\n {\n \"attribute\": \"hand-built\",\n \"cluster_id\": \"0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.peec.ai/customer/v1/brand-perception/attribute-clusters/edit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"project_id\": \"or_f45b94ba-5e35-4982-93ed-285e72ee14eb\",\n \"renames\": [\n {\n \"cluster_id\": \"0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42\",\n \"name\": \"Racing Heritage\"\n }\n ],\n \"delete_cluster_ids\": [\n \"0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42\"\n ],\n \"reassignments\": [\n {\n \"attribute\": \"hand-built\",\n \"cluster_id\": \"0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"renamed_count": 1,
"deleted_count": 1,
"reassigned_count": 3
}Edit Brand Perception Attribute Clusters
Rename, delete and reassign the project’s brand-perception attribute clusters — the same edits the Manage attributes screen makes. The whole call is one transaction: if any edit is rejected nothing is applied, so a cluster can be emptied by reassignments and deleted in the same request. Edits apply in the order reassign, rename, delete regardless of how they are listed. Scores re-aggregate on the next read, so no new scraping run is needed. Naming one attribute or cluster twice in a call is rejected, since the two edits would race. Errors: 400 when a target is repeated, 404 when a cluster or attribute does not exist, 409 when a new label collides with another cluster or a deleted cluster still holds attributes.
curl --request POST \
--url https://api.peec.ai/customer/v1/brand-perception/attribute-clusters/edit \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"project_id": "or_f45b94ba-5e35-4982-93ed-285e72ee14eb",
"renames": [
{
"cluster_id": "0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42",
"name": "Racing Heritage"
}
],
"delete_cluster_ids": [
"0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42"
],
"reassignments": [
{
"attribute": "hand-built",
"cluster_id": "0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42"
}
]
}
'import requests
url = "https://api.peec.ai/customer/v1/brand-perception/attribute-clusters/edit"
payload = {
"project_id": "or_f45b94ba-5e35-4982-93ed-285e72ee14eb",
"renames": [
{
"cluster_id": "0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42",
"name": "Racing Heritage"
}
],
"delete_cluster_ids": ["0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42"],
"reassignments": [
{
"attribute": "hand-built",
"cluster_id": "0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42"
}
]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
project_id: 'or_f45b94ba-5e35-4982-93ed-285e72ee14eb',
renames: [{cluster_id: '0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42', name: 'Racing Heritage'}],
delete_cluster_ids: ['0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42'],
reassignments: [{attribute: 'hand-built', cluster_id: '0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42'}]
})
};
fetch('https://api.peec.ai/customer/v1/brand-perception/attribute-clusters/edit', 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.peec.ai/customer/v1/brand-perception/attribute-clusters/edit",
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([
'project_id' => 'or_f45b94ba-5e35-4982-93ed-285e72ee14eb',
'renames' => [
[
'cluster_id' => '0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42',
'name' => 'Racing Heritage'
]
],
'delete_cluster_ids' => [
'0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42'
],
'reassignments' => [
[
'attribute' => 'hand-built',
'cluster_id' => '0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.peec.ai/customer/v1/brand-perception/attribute-clusters/edit"
payload := strings.NewReader("{\n \"project_id\": \"or_f45b94ba-5e35-4982-93ed-285e72ee14eb\",\n \"renames\": [\n {\n \"cluster_id\": \"0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42\",\n \"name\": \"Racing Heritage\"\n }\n ],\n \"delete_cluster_ids\": [\n \"0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42\"\n ],\n \"reassignments\": [\n {\n \"attribute\": \"hand-built\",\n \"cluster_id\": \"0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://api.peec.ai/customer/v1/brand-perception/attribute-clusters/edit")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"project_id\": \"or_f45b94ba-5e35-4982-93ed-285e72ee14eb\",\n \"renames\": [\n {\n \"cluster_id\": \"0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42\",\n \"name\": \"Racing Heritage\"\n }\n ],\n \"delete_cluster_ids\": [\n \"0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42\"\n ],\n \"reassignments\": [\n {\n \"attribute\": \"hand-built\",\n \"cluster_id\": \"0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.peec.ai/customer/v1/brand-perception/attribute-clusters/edit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"project_id\": \"or_f45b94ba-5e35-4982-93ed-285e72ee14eb\",\n \"renames\": [\n {\n \"cluster_id\": \"0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42\",\n \"name\": \"Racing Heritage\"\n }\n ],\n \"delete_cluster_ids\": [\n \"0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42\"\n ],\n \"reassignments\": [\n {\n \"attribute\": \"hand-built\",\n \"cluster_id\": \"0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"renamed_count": 1,
"deleted_count": 1,
"reassigned_count": 3
}Authorizations
Body
Required if using a company api key
"or_f45b94ba-5e35-4982-93ed-285e72ee14eb"
Clusters to relabel.
50Show child attributes
Show child attributes
Clusters to remove. A cluster must hold no attributes when it is deleted — move them out in the same call.
50["0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42"]
Attributes to move into a different cluster.
200Show child attributes
Show child attributes
