Create a segment
curl --request POST \
--url https://api.example.com/api/v2/segmentsimport requests
url = "https://api.example.com/api/v2/segments"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/api/v2/segments', 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.example.com/api/v2/segments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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.example.com/api/v2/segments"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/api/v2/segments")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v2/segments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodySegments
Create a segment
Create a reusable segment (filter set) that can be added to streams later
POST
/
api
/
v2
/
segments
Create a segment
curl --request POST \
--url https://api.example.com/api/v2/segmentsimport requests
url = "https://api.example.com/api/v2/segments"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/api/v2/segments', 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.example.com/api/v2/segments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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.example.com/api/v2/segments"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/api/v2/segments")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v2/segments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyCreates a new segment. The returned
id can be passed as segmentId in a pairs[] entry on POST /api/v2/streams or PATCH /api/v2/streams/.
If you’d rather author the segment inline as part of stream creation, pass an inline segment: {...} object in the pair instead.
Body
| Field | Type | Description |
|---|---|---|
description | string (required) | What this segment is looking for |
name | string | Optional display name |
genderValues | array | e.g. ["female"] |
appliedSearchFilters | object | e.g. { "job_role": ["Founder", "CEO"], "skill": ["AI/ML"] } |
followerCountTiers | array | e.g. ["10k_to_100k"] |
Example
curl -X POST https://www.catchthegoodones.com/api/v2/segments \
-H "Authorization: Bearer ctgo_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"description": "AI founders building developer tools",
"appliedSearchFilters": { "job_role": ["Founder", "CEO"], "skill": ["AI/ML"] }
}'
Response
{ "id": 12, "userFacingId": "seg_12" }
Errors
| Code | HTTP | When |
|---|---|---|
orphan_label | 400 | appliedSearchFilters contained labels with no canonical match. Response includes orphans[] listing them. |
Auth
Bearer or session cookie.⌘I