Get Segments
Get detail information of a segment and its associated definition(s) and action(s) for a title.
Error codes
This operation may return the following PlayFab errors:
| Error | Code |
|---|---|
| GetSegmentsRateLimitExceeded | 10010 |
| ProductDisabledForTitle | 1609 |
| UnknownError | 1039 |
POST
/
Admin
/
GetSegments
Get Segments
curl --request POST \
--url https://{titleId}.playfabapi.com/Admin/GetSegments \
--header 'Content-Type: application/json' \
--header 'X-SecretKey: <api-key>' \
--data '
{
"SegmentIds": [
"B05FC8CB558A6570",
"97EF0E9302CBE996"
]
}
'import requests
url = "https://{titleId}.playfabapi.com/Admin/GetSegments"
payload = { "SegmentIds": ["B05FC8CB558A6570", "97EF0E9302CBE996"] }
headers = {
"X-SecretKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-SecretKey': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({SegmentIds: ['B05FC8CB558A6570', '97EF0E9302CBE996']})
};
fetch('https://{titleId}.playfabapi.com/Admin/GetSegments', 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://{titleId}.playfabapi.com/Admin/GetSegments",
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([
'SegmentIds' => [
'B05FC8CB558A6570',
'97EF0E9302CBE996'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-SecretKey: <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://{titleId}.playfabapi.com/Admin/GetSegments"
payload := strings.NewReader("{\n \"SegmentIds\": [\n \"B05FC8CB558A6570\",\n \"97EF0E9302CBE996\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-SecretKey", "<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://{titleId}.playfabapi.com/Admin/GetSegments")
.header("X-SecretKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"SegmentIds\": [\n \"B05FC8CB558A6570\",\n \"97EF0E9302CBE996\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{titleId}.playfabapi.com/Admin/GetSegments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-SecretKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"SegmentIds\": [\n \"B05FC8CB558A6570\",\n \"97EF0E9302CBE996\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"code": 123,
"status": "<string>",
"data": {
"ErrorMessage": "<string>",
"Segments": [
{
"LastUpdateTime": "<string>",
"Description": "<string>",
"EnteredSegmentActions": [
{
"AddInventoryItemsV2Action": {
"Amount": 123,
"CollectionId": "<string>",
"DurationInSeconds": 123,
"ItemId": "<string>",
"StackId": "<string>"
},
"BanPlayerAction": {
"BanHours": 123,
"ReasonForBan": "<string>"
},
"DeleteInventoryItemsV2Action": {
"CollectionId": "<string>",
"ItemId": "<string>",
"StackId": "<string>"
},
"DeletePlayerAction": {},
"DeletePlayerStatisticAction": {
"StatisticName": "<string>"
},
"EmailNotificationAction": {
"EmailTemplateId": "<string>",
"EmailTemplateName": "<string>"
},
"ExecuteAzureFunctionAction": {
"GenerateFunctionExecutedEvents": true,
"AzureFunction": "<string>",
"FunctionParameter": {}
},
"ExecuteCloudScriptAction": {
"CloudScriptPublishResultsToPlayStream": true,
"CloudScriptFunction": "<string>",
"FunctionParameter": {},
"FunctionParameterJson": "<string>"
},
"GrantItemAction": {
"Quantity": 123,
"CatelogId": "<string>",
"ItemId": "<string>"
},
"GrantVirtualCurrencyAction": {
"Amount": 123,
"CurrencyCode": "<string>"
},
"IncrementPlayerStatisticAction": {
"IncrementValue": 123,
"StatisticName": "<string>"
},
"PushNotificationAction": {
"PushNotificationTemplateId": "<string>"
},
"SubtractInventoryItemsV2Action": {
"Amount": 123,
"CollectionId": "<string>",
"DurationInSeconds": 123,
"ItemId": "<string>",
"StackId": "<string>"
}
}
],
"LeftSegmentActions": [
{
"AddInventoryItemsV2Action": {
"Amount": 123,
"CollectionId": "<string>",
"DurationInSeconds": 123,
"ItemId": "<string>",
"StackId": "<string>"
},
"BanPlayerAction": {
"BanHours": 123,
"ReasonForBan": "<string>"
},
"DeleteInventoryItemsV2Action": {
"CollectionId": "<string>",
"ItemId": "<string>",
"StackId": "<string>"
},
"DeletePlayerAction": {},
"DeletePlayerStatisticAction": {
"StatisticName": "<string>"
},
"EmailNotificationAction": {
"EmailTemplateId": "<string>",
"EmailTemplateName": "<string>"
},
"ExecuteAzureFunctionAction": {
"GenerateFunctionExecutedEvents": true,
"AzureFunction": "<string>",
"FunctionParameter": {}
},
"ExecuteCloudScriptAction": {
"CloudScriptPublishResultsToPlayStream": true,
"CloudScriptFunction": "<string>",
"FunctionParameter": {},
"FunctionParameterJson": "<string>"
},
"GrantItemAction": {
"Quantity": 123,
"CatelogId": "<string>",
"ItemId": "<string>"
},
"GrantVirtualCurrencyAction": {
"Amount": 123,
"CurrencyCode": "<string>"
},
"IncrementPlayerStatisticAction": {
"IncrementValue": 123,
"StatisticName": "<string>"
},
"PushNotificationAction": {
"PushNotificationTemplateId": "<string>"
},
"SubtractInventoryItemsV2Action": {
"Amount": 123,
"CollectionId": "<string>",
"DurationInSeconds": 123,
"ItemId": "<string>",
"StackId": "<string>"
}
}
],
"Name": "<string>",
"SegmentId": "<string>",
"SegmentOrDefinitions": [
{
"SegmentAndDefinitions": [
{
"AdCampaignFilter": {
"CampaignId": "<string>",
"CampaignSource": "<string>",
"Comparison": "GreaterThan"
},
"AllPlayersFilter": {},
"ChurnPredictionFilter": {
"Comparison": "GreaterThan",
"RiskLevel": "NoData"
},
"CustomPropertyBooleanFilter": {
"PropertyValue": true,
"Comparison": "GreaterThan",
"PropertyName": "<string>"
},
"CustomPropertyDateTimeFilter": {
"PropertyValue": "<string>",
"Comparison": "GreaterThan",
"PropertyName": "<string>"
},
"CustomPropertyNumericFilter": {
"PropertyValue": 123,
"Comparison": "GreaterThan",
"PropertyName": "<string>"
},
"CustomPropertyStringFilter": {
"Comparison": "GreaterThan",
"PropertyName": "<string>",
"PropertyValue": "<string>"
},
"FirstLoginDateFilter": {
"LogInDate": "<string>",
"Comparison": "GreaterThan"
},
"FirstLoginFilter": {
"DurationInMinutes": 123,
"Comparison": "GreaterThan"
},
"LastLoginDateFilter": {
"LogInDate": "<string>",
"Comparison": "GreaterThan"
},
"LastLoginFilter": {
"DurationInMinutes": 123,
"Comparison": "GreaterThan"
},
"LinkedUserAccountFilter": {
"LoginProvider": "Unknown"
},
"LinkedUserAccountHasEmailFilter": {
"Comparison": "GreaterThan",
"LoginProvider": "Unknown"
},
"LocationFilter": {
"CountryCode": "AF"
},
"PlayerChurnPredictionFilter": {
"Comparison": "GreaterThan",
"RiskLevel": "NoData"
},
"PlayerChurnPredictionTimeFilter": {
"DurationInDays": 123,
"Comparison": "GreaterThan"
},
"PlayerChurnPreviousPredictionFilter": {
"Comparison": "GreaterThan",
"RiskLevel": "NoData"
},
"PushNotificationFilter": {
"PushNotificationDevicePlatform": "ApplePushNotificationService"
},
"StatisticFilter": {
"Comparison": "GreaterThan",
"FilterValue": "<string>",
"Name": "<string>",
"UseCurrentVersion": true,
"Version": 123
},
"TagFilter": {
"Comparison": "GreaterThan",
"TagValue": "<string>"
},
"TotalValueToDateInUSDFilter": {
"Amount": "<string>",
"Comparison": "GreaterThan"
},
"UserOriginationFilter": {
"LoginProvider": "Unknown"
},
"ValueToDateFilter": {
"Amount": "<string>",
"Comparison": "GreaterThan",
"Currency": "AED"
},
"VirtualCurrencyBalanceFilter": {
"Amount": 123,
"Comparison": "GreaterThan",
"CurrencyCode": "<string>"
}
}
]
}
]
}
]
}
}{
"code": 123,
"errorCode": 123,
"status": "<string>",
"error": "<string>",
"errorMessage": "<string>",
"errorDetails": {}
}Authorizations
This API requires a title secret key, available to title admins, from PlayFab Game Manager.
Body
application/json
Given input segment ids, return list of segments.
Given input segment ids, return list of segments.
Segment ids to filter title segments.
Last modified on October 1, 2026
Was this page helpful?
⌘I
Get Segments
curl --request POST \
--url https://{titleId}.playfabapi.com/Admin/GetSegments \
--header 'Content-Type: application/json' \
--header 'X-SecretKey: <api-key>' \
--data '
{
"SegmentIds": [
"B05FC8CB558A6570",
"97EF0E9302CBE996"
]
}
'import requests
url = "https://{titleId}.playfabapi.com/Admin/GetSegments"
payload = { "SegmentIds": ["B05FC8CB558A6570", "97EF0E9302CBE996"] }
headers = {
"X-SecretKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-SecretKey': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({SegmentIds: ['B05FC8CB558A6570', '97EF0E9302CBE996']})
};
fetch('https://{titleId}.playfabapi.com/Admin/GetSegments', 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://{titleId}.playfabapi.com/Admin/GetSegments",
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([
'SegmentIds' => [
'B05FC8CB558A6570',
'97EF0E9302CBE996'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-SecretKey: <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://{titleId}.playfabapi.com/Admin/GetSegments"
payload := strings.NewReader("{\n \"SegmentIds\": [\n \"B05FC8CB558A6570\",\n \"97EF0E9302CBE996\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-SecretKey", "<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://{titleId}.playfabapi.com/Admin/GetSegments")
.header("X-SecretKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"SegmentIds\": [\n \"B05FC8CB558A6570\",\n \"97EF0E9302CBE996\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{titleId}.playfabapi.com/Admin/GetSegments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-SecretKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"SegmentIds\": [\n \"B05FC8CB558A6570\",\n \"97EF0E9302CBE996\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"code": 123,
"status": "<string>",
"data": {
"ErrorMessage": "<string>",
"Segments": [
{
"LastUpdateTime": "<string>",
"Description": "<string>",
"EnteredSegmentActions": [
{
"AddInventoryItemsV2Action": {
"Amount": 123,
"CollectionId": "<string>",
"DurationInSeconds": 123,
"ItemId": "<string>",
"StackId": "<string>"
},
"BanPlayerAction": {
"BanHours": 123,
"ReasonForBan": "<string>"
},
"DeleteInventoryItemsV2Action": {
"CollectionId": "<string>",
"ItemId": "<string>",
"StackId": "<string>"
},
"DeletePlayerAction": {},
"DeletePlayerStatisticAction": {
"StatisticName": "<string>"
},
"EmailNotificationAction": {
"EmailTemplateId": "<string>",
"EmailTemplateName": "<string>"
},
"ExecuteAzureFunctionAction": {
"GenerateFunctionExecutedEvents": true,
"AzureFunction": "<string>",
"FunctionParameter": {}
},
"ExecuteCloudScriptAction": {
"CloudScriptPublishResultsToPlayStream": true,
"CloudScriptFunction": "<string>",
"FunctionParameter": {},
"FunctionParameterJson": "<string>"
},
"GrantItemAction": {
"Quantity": 123,
"CatelogId": "<string>",
"ItemId": "<string>"
},
"GrantVirtualCurrencyAction": {
"Amount": 123,
"CurrencyCode": "<string>"
},
"IncrementPlayerStatisticAction": {
"IncrementValue": 123,
"StatisticName": "<string>"
},
"PushNotificationAction": {
"PushNotificationTemplateId": "<string>"
},
"SubtractInventoryItemsV2Action": {
"Amount": 123,
"CollectionId": "<string>",
"DurationInSeconds": 123,
"ItemId": "<string>",
"StackId": "<string>"
}
}
],
"LeftSegmentActions": [
{
"AddInventoryItemsV2Action": {
"Amount": 123,
"CollectionId": "<string>",
"DurationInSeconds": 123,
"ItemId": "<string>",
"StackId": "<string>"
},
"BanPlayerAction": {
"BanHours": 123,
"ReasonForBan": "<string>"
},
"DeleteInventoryItemsV2Action": {
"CollectionId": "<string>",
"ItemId": "<string>",
"StackId": "<string>"
},
"DeletePlayerAction": {},
"DeletePlayerStatisticAction": {
"StatisticName": "<string>"
},
"EmailNotificationAction": {
"EmailTemplateId": "<string>",
"EmailTemplateName": "<string>"
},
"ExecuteAzureFunctionAction": {
"GenerateFunctionExecutedEvents": true,
"AzureFunction": "<string>",
"FunctionParameter": {}
},
"ExecuteCloudScriptAction": {
"CloudScriptPublishResultsToPlayStream": true,
"CloudScriptFunction": "<string>",
"FunctionParameter": {},
"FunctionParameterJson": "<string>"
},
"GrantItemAction": {
"Quantity": 123,
"CatelogId": "<string>",
"ItemId": "<string>"
},
"GrantVirtualCurrencyAction": {
"Amount": 123,
"CurrencyCode": "<string>"
},
"IncrementPlayerStatisticAction": {
"IncrementValue": 123,
"StatisticName": "<string>"
},
"PushNotificationAction": {
"PushNotificationTemplateId": "<string>"
},
"SubtractInventoryItemsV2Action": {
"Amount": 123,
"CollectionId": "<string>",
"DurationInSeconds": 123,
"ItemId": "<string>",
"StackId": "<string>"
}
}
],
"Name": "<string>",
"SegmentId": "<string>",
"SegmentOrDefinitions": [
{
"SegmentAndDefinitions": [
{
"AdCampaignFilter": {
"CampaignId": "<string>",
"CampaignSource": "<string>",
"Comparison": "GreaterThan"
},
"AllPlayersFilter": {},
"ChurnPredictionFilter": {
"Comparison": "GreaterThan",
"RiskLevel": "NoData"
},
"CustomPropertyBooleanFilter": {
"PropertyValue": true,
"Comparison": "GreaterThan",
"PropertyName": "<string>"
},
"CustomPropertyDateTimeFilter": {
"PropertyValue": "<string>",
"Comparison": "GreaterThan",
"PropertyName": "<string>"
},
"CustomPropertyNumericFilter": {
"PropertyValue": 123,
"Comparison": "GreaterThan",
"PropertyName": "<string>"
},
"CustomPropertyStringFilter": {
"Comparison": "GreaterThan",
"PropertyName": "<string>",
"PropertyValue": "<string>"
},
"FirstLoginDateFilter": {
"LogInDate": "<string>",
"Comparison": "GreaterThan"
},
"FirstLoginFilter": {
"DurationInMinutes": 123,
"Comparison": "GreaterThan"
},
"LastLoginDateFilter": {
"LogInDate": "<string>",
"Comparison": "GreaterThan"
},
"LastLoginFilter": {
"DurationInMinutes": 123,
"Comparison": "GreaterThan"
},
"LinkedUserAccountFilter": {
"LoginProvider": "Unknown"
},
"LinkedUserAccountHasEmailFilter": {
"Comparison": "GreaterThan",
"LoginProvider": "Unknown"
},
"LocationFilter": {
"CountryCode": "AF"
},
"PlayerChurnPredictionFilter": {
"Comparison": "GreaterThan",
"RiskLevel": "NoData"
},
"PlayerChurnPredictionTimeFilter": {
"DurationInDays": 123,
"Comparison": "GreaterThan"
},
"PlayerChurnPreviousPredictionFilter": {
"Comparison": "GreaterThan",
"RiskLevel": "NoData"
},
"PushNotificationFilter": {
"PushNotificationDevicePlatform": "ApplePushNotificationService"
},
"StatisticFilter": {
"Comparison": "GreaterThan",
"FilterValue": "<string>",
"Name": "<string>",
"UseCurrentVersion": true,
"Version": 123
},
"TagFilter": {
"Comparison": "GreaterThan",
"TagValue": "<string>"
},
"TotalValueToDateInUSDFilter": {
"Amount": "<string>",
"Comparison": "GreaterThan"
},
"UserOriginationFilter": {
"LoginProvider": "Unknown"
},
"ValueToDateFilter": {
"Amount": "<string>",
"Comparison": "GreaterThan",
"Currency": "AED"
},
"VirtualCurrencyBalanceFilter": {
"Amount": 123,
"Comparison": "GreaterThan",
"CurrencyCode": "<string>"
}
}
]
}
]
}
]
}
}{
"code": 123,
"errorCode": 123,
"status": "<string>",
"error": "<string>",
"errorMessage": "<string>",
"errorDetails": {}
}