Update category configuration
curl --request PUT \
--url https://your-instance.example.com/api/contact-metrics/config \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"categories": [
{
"name": "New",
"key": "new",
"statuses": [
"new"
],
"color": "#3B82F6"
},
{
"name": "Working",
"key": "working",
"statuses": [
"qualified",
"in-progress"
],
"color": "#10B981"
},
{
"name": "Closed",
"key": "closed",
"statuses": [
"won",
"lost"
],
"color": "#6B7280"
}
],
"allowMultipleCategories": false
}
'import requests
url = "https://your-instance.example.com/api/contact-metrics/config"
payload = {
"categories": [
{
"name": "New",
"key": "new",
"statuses": ["new"],
"color": "#3B82F6"
},
{
"name": "Working",
"key": "working",
"statuses": ["qualified", "in-progress"],
"color": "#10B981"
},
{
"name": "Closed",
"key": "closed",
"statuses": ["won", "lost"],
"color": "#6B7280"
}
],
"allowMultipleCategories": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
categories: [
{name: 'New', key: 'new', statuses: ['new'], color: '#3B82F6'},
{
name: 'Working',
key: 'working',
statuses: ['qualified', 'in-progress'],
color: '#10B981'
},
{name: 'Closed', key: 'closed', statuses: ['won', 'lost'], color: '#6B7280'}
],
allowMultipleCategories: false
})
};
fetch('https://your-instance.example.com/api/contact-metrics/config', 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://your-instance.example.com/api/contact-metrics/config",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'categories' => [
[
'name' => 'New',
'key' => 'new',
'statuses' => [
'new'
],
'color' => '#3B82F6'
],
[
'name' => 'Working',
'key' => 'working',
'statuses' => [
'qualified',
'in-progress'
],
'color' => '#10B981'
],
[
'name' => 'Closed',
'key' => 'closed',
'statuses' => [
'won',
'lost'
],
'color' => '#6B7280'
]
],
'allowMultipleCategories' => false
]),
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://your-instance.example.com/api/contact-metrics/config"
payload := strings.NewReader("{\n \"categories\": [\n {\n \"name\": \"New\",\n \"key\": \"new\",\n \"statuses\": [\n \"new\"\n ],\n \"color\": \"#3B82F6\"\n },\n {\n \"name\": \"Working\",\n \"key\": \"working\",\n \"statuses\": [\n \"qualified\",\n \"in-progress\"\n ],\n \"color\": \"#10B981\"\n },\n {\n \"name\": \"Closed\",\n \"key\": \"closed\",\n \"statuses\": [\n \"won\",\n \"lost\"\n ],\n \"color\": \"#6B7280\"\n }\n ],\n \"allowMultipleCategories\": false\n}")
req, _ := http.NewRequest("PUT", 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.put("https://your-instance.example.com/api/contact-metrics/config")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"categories\": [\n {\n \"name\": \"New\",\n \"key\": \"new\",\n \"statuses\": [\n \"new\"\n ],\n \"color\": \"#3B82F6\"\n },\n {\n \"name\": \"Working\",\n \"key\": \"working\",\n \"statuses\": [\n \"qualified\",\n \"in-progress\"\n ],\n \"color\": \"#10B981\"\n },\n {\n \"name\": \"Closed\",\n \"key\": \"closed\",\n \"statuses\": [\n \"won\",\n \"lost\"\n ],\n \"color\": \"#6B7280\"\n }\n ],\n \"allowMultipleCategories\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/contact-metrics/config")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"categories\": [\n {\n \"name\": \"New\",\n \"key\": \"new\",\n \"statuses\": [\n \"new\"\n ],\n \"color\": \"#3B82F6\"\n },\n {\n \"name\": \"Working\",\n \"key\": \"working\",\n \"statuses\": [\n \"qualified\",\n \"in-progress\"\n ],\n \"color\": \"#10B981\"\n },\n {\n \"name\": \"Closed\",\n \"key\": \"closed\",\n \"statuses\": [\n \"won\",\n \"lost\"\n ],\n \"color\": \"#6B7280\"\n }\n ],\n \"allowMultipleCategories\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"categories": [
{
"name": "New",
"key": "new",
"statuses": [
"new"
],
"color": "#3B82F6"
},
{
"name": "Working",
"key": "working",
"statuses": [
"qualified",
"in-progress"
],
"color": "#10B981"
}
],
"allowMultipleCategories": false,
"defaultMetricsPipelineId": "66f0a0b0c0d0e0f0a0b0c0d0"
}
}{
"error": "Invalid pipeline ID"
}{
"error": "Invalid pipeline ID"
}{
"error": "Invalid pipeline ID"
}{
"error": "Invalid pipeline ID"
}Contact Metrics
Update category configuration
Update the org-wide metrics categories. ADMIN/SUPERADMIN only. Categories cover existing statuses — orphaned contacts roll up under “uncategorized” in the summary endpoint.
PUT
/
api
/
contact-metrics
/
config
Update category configuration
curl --request PUT \
--url https://your-instance.example.com/api/contact-metrics/config \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"categories": [
{
"name": "New",
"key": "new",
"statuses": [
"new"
],
"color": "#3B82F6"
},
{
"name": "Working",
"key": "working",
"statuses": [
"qualified",
"in-progress"
],
"color": "#10B981"
},
{
"name": "Closed",
"key": "closed",
"statuses": [
"won",
"lost"
],
"color": "#6B7280"
}
],
"allowMultipleCategories": false
}
'import requests
url = "https://your-instance.example.com/api/contact-metrics/config"
payload = {
"categories": [
{
"name": "New",
"key": "new",
"statuses": ["new"],
"color": "#3B82F6"
},
{
"name": "Working",
"key": "working",
"statuses": ["qualified", "in-progress"],
"color": "#10B981"
},
{
"name": "Closed",
"key": "closed",
"statuses": ["won", "lost"],
"color": "#6B7280"
}
],
"allowMultipleCategories": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
categories: [
{name: 'New', key: 'new', statuses: ['new'], color: '#3B82F6'},
{
name: 'Working',
key: 'working',
statuses: ['qualified', 'in-progress'],
color: '#10B981'
},
{name: 'Closed', key: 'closed', statuses: ['won', 'lost'], color: '#6B7280'}
],
allowMultipleCategories: false
})
};
fetch('https://your-instance.example.com/api/contact-metrics/config', 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://your-instance.example.com/api/contact-metrics/config",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'categories' => [
[
'name' => 'New',
'key' => 'new',
'statuses' => [
'new'
],
'color' => '#3B82F6'
],
[
'name' => 'Working',
'key' => 'working',
'statuses' => [
'qualified',
'in-progress'
],
'color' => '#10B981'
],
[
'name' => 'Closed',
'key' => 'closed',
'statuses' => [
'won',
'lost'
],
'color' => '#6B7280'
]
],
'allowMultipleCategories' => false
]),
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://your-instance.example.com/api/contact-metrics/config"
payload := strings.NewReader("{\n \"categories\": [\n {\n \"name\": \"New\",\n \"key\": \"new\",\n \"statuses\": [\n \"new\"\n ],\n \"color\": \"#3B82F6\"\n },\n {\n \"name\": \"Working\",\n \"key\": \"working\",\n \"statuses\": [\n \"qualified\",\n \"in-progress\"\n ],\n \"color\": \"#10B981\"\n },\n {\n \"name\": \"Closed\",\n \"key\": \"closed\",\n \"statuses\": [\n \"won\",\n \"lost\"\n ],\n \"color\": \"#6B7280\"\n }\n ],\n \"allowMultipleCategories\": false\n}")
req, _ := http.NewRequest("PUT", 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.put("https://your-instance.example.com/api/contact-metrics/config")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"categories\": [\n {\n \"name\": \"New\",\n \"key\": \"new\",\n \"statuses\": [\n \"new\"\n ],\n \"color\": \"#3B82F6\"\n },\n {\n \"name\": \"Working\",\n \"key\": \"working\",\n \"statuses\": [\n \"qualified\",\n \"in-progress\"\n ],\n \"color\": \"#10B981\"\n },\n {\n \"name\": \"Closed\",\n \"key\": \"closed\",\n \"statuses\": [\n \"won\",\n \"lost\"\n ],\n \"color\": \"#6B7280\"\n }\n ],\n \"allowMultipleCategories\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/contact-metrics/config")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"categories\": [\n {\n \"name\": \"New\",\n \"key\": \"new\",\n \"statuses\": [\n \"new\"\n ],\n \"color\": \"#3B82F6\"\n },\n {\n \"name\": \"Working\",\n \"key\": \"working\",\n \"statuses\": [\n \"qualified\",\n \"in-progress\"\n ],\n \"color\": \"#10B981\"\n },\n {\n \"name\": \"Closed\",\n \"key\": \"closed\",\n \"statuses\": [\n \"won\",\n \"lost\"\n ],\n \"color\": \"#6B7280\"\n }\n ],\n \"allowMultipleCategories\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"categories": [
{
"name": "New",
"key": "new",
"statuses": [
"new"
],
"color": "#3B82F6"
},
{
"name": "Working",
"key": "working",
"statuses": [
"qualified",
"in-progress"
],
"color": "#10B981"
}
],
"allowMultipleCategories": false,
"defaultMetricsPipelineId": "66f0a0b0c0d0e0f0a0b0c0d0"
}
}{
"error": "Invalid pipeline ID"
}{
"error": "Invalid pipeline ID"
}{
"error": "Invalid pipeline ID"
}{
"error": "Invalid pipeline ID"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
⌘I