List segments
curl --request GET \
--url https://api.bigco.ai/api/v1/segments \
--header 'x-bigco-hmac-sha256: <api-key>'import requests
url = "https://api.bigco.ai/api/v1/segments"
headers = {"x-bigco-hmac-sha256": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-bigco-hmac-sha256': '<api-key>'}};
fetch('https://api.bigco.ai/api/v1/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.bigco.ai/api/v1/segments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-bigco-hmac-sha256: <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://api.bigco.ai/api/v1/segments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-bigco-hmac-sha256", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.bigco.ai/api/v1/segments")
.header("x-bigco-hmac-sha256", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bigco.ai/api/v1/segments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-bigco-hmac-sha256"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"id": 123,
"brand_id": 37876,
"name": "Loyal customers",
"source": "USER_DEFINED",
"type": "STANDARD",
"is_active": true,
"is_archived": false,
"criteria": [
{
"attribute": {
"dimension_type": 123,
"field_name": "age",
"field_type": 123
},
"operator_type": 123,
"and_group_num": 123,
"str_field_value": "<string>",
"bool_field_value": true,
"int_field_value": 123,
"float_field_value": 123,
"date_field_value": "<string>"
}
],
"date_created": "2024-01-12T15:21:51Z",
"date_last_updated": "2024-01-12T15:21:51Z",
"description": "Customers with 3+ orders",
"is_pinned": false,
"color_id": 3,
"ltv": 250,
"average_order_value": 75.5,
"average_purchase_frequency": 2.4
}
]{
"detail": {
"type": "not_authenticated",
"msg": "HMAC signature verification failed"
}
}{
"detail": {
"type": "UNCAUGHT_ERROR",
"msg": "Internal server error"
}
}List segments
Returns all active (non-archived) segments configured for your brand.
GET
/
segments
List segments
curl --request GET \
--url https://api.bigco.ai/api/v1/segments \
--header 'x-bigco-hmac-sha256: <api-key>'import requests
url = "https://api.bigco.ai/api/v1/segments"
headers = {"x-bigco-hmac-sha256": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-bigco-hmac-sha256': '<api-key>'}};
fetch('https://api.bigco.ai/api/v1/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.bigco.ai/api/v1/segments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-bigco-hmac-sha256: <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://api.bigco.ai/api/v1/segments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-bigco-hmac-sha256", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.bigco.ai/api/v1/segments")
.header("x-bigco-hmac-sha256", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bigco.ai/api/v1/segments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-bigco-hmac-sha256"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"id": 123,
"brand_id": 37876,
"name": "Loyal customers",
"source": "USER_DEFINED",
"type": "STANDARD",
"is_active": true,
"is_archived": false,
"criteria": [
{
"attribute": {
"dimension_type": 123,
"field_name": "age",
"field_type": 123
},
"operator_type": 123,
"and_group_num": 123,
"str_field_value": "<string>",
"bool_field_value": true,
"int_field_value": 123,
"float_field_value": 123,
"date_field_value": "<string>"
}
],
"date_created": "2024-01-12T15:21:51Z",
"date_last_updated": "2024-01-12T15:21:51Z",
"description": "Customers with 3+ orders",
"is_pinned": false,
"color_id": 3,
"ltv": 250,
"average_order_value": 75.5,
"average_purchase_frequency": 2.4
}
]{
"detail": {
"type": "not_authenticated",
"msg": "HMAC signature verification failed"
}
}{
"detail": {
"type": "UNCAUGHT_ERROR",
"msg": "Internal server error"
}
}Authorizations
Base64-encoded HMAC-SHA256 signature of the request. Every request must also include the x-bigco-hmac-username and x-date headers, and POST/PUT requests must include x-digest. See the Authentication guide for the full signing procedure.
Response
Your brand's segments.
Example:
123
Example:
37876
The segment name, unique within your brand.
Example:
"Loyal customers"
Where the segment originated (e.g. USER_DEFINED, KLAVIYO).
Example:
"USER_DEFINED"
The segment type (e.g. STANDARD, POINT IN TIME).
Example:
"STANDARD"
Example:
true
Example:
false
Show child attributes
Show child attributes
Example:
"2024-01-12T15:21:51Z"
Example:
"2024-01-12T15:21:51Z"
Example:
"Customers with 3+ orders"
Example:
false
Example:
3
Average lifetime value of users in the segment.
Example:
250
Example:
75.5
Example:
2.4
⌘I