Archive a segment
curl --request POST \
--url https://galinum.com/api/v1/segments/{id}/archive \
--header 'Authorization: Bearer <token>'import requests
url = "https://galinum.com/api/v1/segments/{id}/archive"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://galinum.com/api/v1/segments/{id}/archive', 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://galinum.com/api/v1/segments/{id}/archive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <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"
"net/http"
"io"
)
func main() {
url := "https://galinum.com/api/v1/segments/{id}/archive"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://galinum.com/api/v1/segments/{id}/archive")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://galinum.com/api/v1/segments/{id}/archive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"segment": {
"id": "seg_5d2f0f0e-9a1b-4c1d-8e2f-3a4b5c6d7e8f",
"key": "free-users",
"name": "Free users",
"description": "<string>",
"status": "active",
"currentVersion": 123,
"currentAudienceVersionId": "<string>",
"summary": "<string>",
"createdBy": "<string>",
"createdAt": 123,
"updatedAt": 123,
"schemaVersion": 123,
"expression": {
"version": 1,
"root": {
"kind": "all",
"children": [
{
"kind": "field",
"field": {
"kind": "trait",
"key": "plan"
},
"op": "eq",
"value": "free"
},
{
"kind": "not",
"child": {
"kind": "event",
"event": "used_csv_export"
}
}
]
}
},
"expressionHash": "<string>",
"reason": "<string>"
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Audiences
Archive a segment
Removes the segment from new selection: campaigns can no longer reference it, and its rules can no longer be revised. Its version history stays readable and campaigns already pinning its versions keep delivering unchanged. There is no delete and no unarchive.
POST
/
api
/
v1
/
segments
/
{id}
/
archive
Archive a segment
curl --request POST \
--url https://galinum.com/api/v1/segments/{id}/archive \
--header 'Authorization: Bearer <token>'import requests
url = "https://galinum.com/api/v1/segments/{id}/archive"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://galinum.com/api/v1/segments/{id}/archive', 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://galinum.com/api/v1/segments/{id}/archive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <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"
"net/http"
"io"
)
func main() {
url := "https://galinum.com/api/v1/segments/{id}/archive"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://galinum.com/api/v1/segments/{id}/archive")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://galinum.com/api/v1/segments/{id}/archive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"segment": {
"id": "seg_5d2f0f0e-9a1b-4c1d-8e2f-3a4b5c6d7e8f",
"key": "free-users",
"name": "Free users",
"description": "<string>",
"status": "active",
"currentVersion": 123,
"currentAudienceVersionId": "<string>",
"summary": "<string>",
"createdBy": "<string>",
"createdAt": 123,
"updatedAt": 123,
"schemaVersion": 123,
"expression": {
"version": 1,
"root": {
"kind": "all",
"children": [
{
"kind": "field",
"field": {
"kind": "trait",
"key": "plan"
},
"op": "eq",
"value": "free"
},
{
"kind": "not",
"child": {
"kind": "event",
"event": "used_csv_export"
}
}
]
}
},
"expressionHash": "<string>",
"reason": "<string>"
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Your project's secret key (pk_…, without the pub segment). Server-side only — never ship it to a browser. Get it from Settings → Projects in the dashboard.
Path Parameters
Segment id (seg_…) or machine key.
Response
Archived segment.
Show child attributes
Show child attributes