Share via


Segments - Update Segment

Updates an existing player segment and its associated definition(s) and action(s) for a title.

POST https://titleId.playfabapi.com/Admin/UpdateSegment

Request Header

Name Required Type Description
X-SecretKey True

string

This API requires a title secret key, available to title admins, from PlayFab Game Manager.

Request Body

Name Required Type Description
SegmentModel True

SegmentModel

Segment model with all of the segment properties data.

Responses

Name Type Description
200 OK

UpdateSegmentResponse

400 Bad Request

ApiErrorWrapper

This is the outer wrapper for all responses with errors

Security

X-SecretKey

This API requires a title secret key, available to title admins, from PlayFab Game Manager.

Type: apiKey
In: header

Definitions

Name Description
AdCampaignSegmentFilter
AddInventoryItemsV2SegmentAction
AllPlayersSegmentFilter
ApiErrorWrapper

The basic wrapper around every failed API response

BanPlayerSegmentAction
ChurnPredictionSegmentFilter
ChurnRiskLevel
CustomPropertyBooleanSegmentFilter
CustomPropertyDateTimeSegmentFilter
CustomPropertyNumericSegmentFilter
CustomPropertyStringSegmentFilter
DeleteInventoryItemsV2SegmentAction
DeletePlayerSegmentAction
DeletePlayerStatisticSegmentAction
EmailNotificationSegmentAction
ExecuteAzureFunctionSegmentAction
ExecuteCloudScriptSegmentAction
FirstLoginDateSegmentFilter
FirstLoginTimespanSegmentFilter
GrantItemSegmentAction
GrantVirtualCurrencySegmentAction
IncrementPlayerStatisticSegmentAction
LastLoginDateSegmentFilter
LastLoginTimespanSegmentFilter
LinkedUserAccountHasEmailSegmentFilter
LinkedUserAccountSegmentFilter
LocationSegmentFilter
PlayerChurnPredictionSegmentFilter
PlayerChurnPredictionTimeSegmentFilter
PlayerChurnPreviousPredictionSegmentFilter
PushNotificationSegmentAction
PushNotificationSegmentFilter
SegmentAndDefinition
SegmentCountryCode
SegmentCurrency
SegmentFilterComparison
SegmentLoginIdentityProvider
SegmentModel
SegmentOrDefinition
SegmentPushNotificationDevicePlatform
SegmentTrigger
StatisticSegmentFilter
SubtractInventoryItemsV2SegmentAction
TagSegmentFilter
TotalValueToDateInUSDSegmentFilter
UpdateSegmentRequest

Update segment properties data which are planning to update

UpdateSegmentResponse
UserOriginationSegmentFilter
ValueToDateSegmentFilter
VirtualCurrencyBalanceSegmentFilter

AdCampaignSegmentFilter

Name Type Description
CampaignId

string

Campaign id.

CampaignSource

string

Campaign source.

Comparison

SegmentFilterComparison

Campaign comparison.

AddInventoryItemsV2SegmentAction

Name Type Description
Amount

number

Amount of the item to be granted to a player

CollectionId

string

The collection id for where the item will be granted in the player inventory

DurationInSeconds

number

The duration in seconds of the subscription to be granted to a player

ItemId

string

The id of item to be granted to the player

StackId

string

The stack id for where the item will be granted in the player inventory

AllPlayersSegmentFilter

ApiErrorWrapper

The basic wrapper around every failed API response

Name Type Description
code

integer

Numerical HTTP code

error

string

Playfab error code

errorCode

integer

Numerical PlayFab error code

errorDetails

object

Detailed description of individual issues with the request object

errorMessage

string

Description for the PlayFab errorCode

status

string

String HTTP code

BanPlayerSegmentAction

Name Type Description
BanHours

number

Ban hours duration.

ReasonForBan

string

Reason for ban.

ChurnPredictionSegmentFilter

Name Type Description
Comparison

SegmentFilterComparison

Comparison

RiskLevel

ChurnRiskLevel

RiskLevel

ChurnRiskLevel

Value Description
NoData
LowRisk
MediumRisk
HighRisk

CustomPropertyBooleanSegmentFilter

Name Type Description
Comparison

SegmentFilterComparison

Custom property comparison.

PropertyName

string

Custom property name.

PropertyValue

boolean

Custom property boolean value.

CustomPropertyDateTimeSegmentFilter

Name Type Description
Comparison

SegmentFilterComparison

Custom property comparison.

PropertyName

string

Custom property name.

PropertyValue

string

Custom property datetime value.

CustomPropertyNumericSegmentFilter

Name Type Description
Comparison

SegmentFilterComparison

Custom property comparison.

PropertyName

string

Custom property name.

PropertyValue

number

Custom property numeric value.

CustomPropertyStringSegmentFilter

Name Type Description
Comparison

SegmentFilterComparison

Custom property comparison.

PropertyName

string

Custom property name.

PropertyValue

string

Custom property string value.

DeleteInventoryItemsV2SegmentAction

Name Type Description
CollectionId

string

The collection id for where the item will be removed from the player inventory

ItemId

string

The id of item to be removed from the player

StackId

string

The stack id for where the item will be removed from the player inventory

DeletePlayerSegmentAction

DeletePlayerStatisticSegmentAction

Name Type Description
StatisticName

string

Statistic name.

EmailNotificationSegmentAction

Name Type Description
EmailTemplateId

string

Email template id.

EmailTemplateName

string

Email template name.

ExecuteAzureFunctionSegmentAction

Name Type Description
AzureFunction

string

Azure function.

FunctionParameter

object

Azure function parameter.

GenerateFunctionExecutedEvents

boolean

Generate play stream event.

ExecuteCloudScriptSegmentAction

Name Type Description
CloudScriptFunction

string

Cloud script function.

CloudScriptPublishResultsToPlayStream

boolean

Generate play stream event.

FunctionParameter

object

Cloud script function parameter.

FunctionParameterJson

string

Cloud script function parameter json text.

FirstLoginDateSegmentFilter

Name Type Description
Comparison

SegmentFilterComparison

First player login date comparison.

LogInDate

string

First player login date.

FirstLoginTimespanSegmentFilter

Name Type Description
Comparison

SegmentFilterComparison

First player login duration comparison.

DurationInMinutes

number

First player login duration.

GrantItemSegmentAction

Name Type Description
CatelogId

string

Item catalog id.

ItemId

string

Item id.

Quantity

number

Item quantity.

GrantVirtualCurrencySegmentAction

Name Type Description
Amount

number

Virtual currency amount.

CurrencyCode

string

Virtual currency code.

IncrementPlayerStatisticSegmentAction

Name Type Description
IncrementValue

number

Increment value.

StatisticName

string

Statistic name.

LastLoginDateSegmentFilter

Name Type Description
Comparison

SegmentFilterComparison

Last player login date comparison.

LogInDate

string

Last player login date.

LastLoginTimespanSegmentFilter

Name Type Description
Comparison

SegmentFilterComparison

Last player login duration comparison.

DurationInMinutes

number

Last player login duration.

LinkedUserAccountHasEmailSegmentFilter

Name Type Description
Comparison

SegmentFilterComparison

Login provider comparison.

LoginProvider

SegmentLoginIdentityProvider

Login provider.

LinkedUserAccountSegmentFilter

Name Type Description
LoginProvider

SegmentLoginIdentityProvider

Login provider.

LocationSegmentFilter

Name Type Description
CountryCode

SegmentCountryCode

Segment country code.

PlayerChurnPredictionSegmentFilter

Name Type Description
Comparison

SegmentFilterComparison

Comparison

RiskLevel

ChurnRiskLevel

RiskLevel

PlayerChurnPredictionTimeSegmentFilter

Name Type Description
Comparison

SegmentFilterComparison

Comparison

DurationInDays

number

DurationInDays

PlayerChurnPreviousPredictionSegmentFilter

Name Type Description
Comparison

SegmentFilterComparison

Comparison

RiskLevel

ChurnRiskLevel

RiskLevel

PushNotificationSegmentAction

Name Type Description
PushNotificationTemplateId

string

Push notification template id.

PushNotificationSegmentFilter

Name Type Description
PushNotificationDevicePlatform

SegmentPushNotificationDevicePlatform

Push notification device platform.

SegmentAndDefinition

Name Type Description
AdCampaignFilter

AdCampaignSegmentFilter

Filter property for ad campaign filter.

AllPlayersFilter

AllPlayersSegmentFilter

property for all player filter.

ChurnPredictionFilter

ChurnPredictionSegmentFilter

Filter property for player churn risk level.

CustomPropertyBooleanFilter

CustomPropertyBooleanSegmentFilter

Filter property for boolean custom properties.

CustomPropertyDateTimeFilter

CustomPropertyDateTimeSegmentFilter

Filter property for datetime custom properties.

CustomPropertyNumericFilter

CustomPropertyNumericSegmentFilter

Filter property for numeric custom properties.

CustomPropertyStringFilter

CustomPropertyStringSegmentFilter

Filter property for string custom properties.

FirstLoginDateFilter

FirstLoginDateSegmentFilter

Filter property for first login date.

FirstLoginFilter

FirstLoginTimespanSegmentFilter

Filter property for first login timespan.

LastLoginDateFilter

LastLoginDateSegmentFilter

Filter property for last login date.

LastLoginFilter

LastLoginTimespanSegmentFilter

Filter property for last login timespan.

LinkedUserAccountFilter

LinkedUserAccountSegmentFilter

Filter property for linked in user account.

LinkedUserAccountHasEmailFilter

LinkedUserAccountHasEmailSegmentFilter

Filter property for linked in user account has email.

LocationFilter

LocationSegmentFilter

Filter property for location.

PlayerChurnPredictionFilter

PlayerChurnPredictionSegmentFilter

Filter property for current player churn value.

PlayerChurnPredictionTimeFilter

PlayerChurnPredictionTimeSegmentFilter

Filter property for player churn timespan.

PlayerChurnPreviousPredictionFilter

PlayerChurnPreviousPredictionSegmentFilter

Filter property for previous player churn value.

PushNotificationFilter

PushNotificationSegmentFilter

Filter property for push notification.

StatisticFilter

StatisticSegmentFilter

Filter property for statistics.

TagFilter

TagSegmentFilter

Filter property for tags.

TotalValueToDateInUSDFilter

TotalValueToDateInUSDSegmentFilter

Filter property for total value to date in USD.

UserOriginationFilter

UserOriginationSegmentFilter

Filter property for user origination.

ValueToDateFilter

ValueToDateSegmentFilter

Filter property for value to date.

VirtualCurrencyBalanceFilter

VirtualCurrencyBalanceSegmentFilter

Filter property for virtual currency.

SegmentCountryCode

Value Description
AF
AX
AL
DZ
AS
AD
AO
AI
AQ
AG
AR
AM
AW
AU
AT
AZ
BS
BH
BD
BB
BY
BE
BZ
BJ
BM
BT
BO
BQ
BA
BW
BV
BR
IO
BN
BG
BF
BI
KH
CM
CA
CV
KY
CF
TD
CL
CN
CX
CC
CO
KM
CG
CD
CK
CR
CI
HR
CU
CW
CY
CZ
DK
DJ
DM
DO
EC
EG
SV
GQ
ER
EE
ET
FK
FO
FJ
FI
FR
GF
PF
TF
GA
GM
GE
DE
GH
GI
GR
GL
GD
GP
GU
GT
GG
GN
GW
GY
HT
HM
VA
HN
HK
HU
IS
IN
ID
IR
IQ
IE
IM
IL
IT
JM
JP
JE
JO
KZ
KE
KI
KP
KR
KW
KG
LA
LV
LB
LS
LR
LY
LI
LT
LU
MO
MK
MG
MW
MY
MV
ML
MT
MH
MQ
MR
MU
YT
MX
FM
MD
MC
MN
ME
MS
MA
MZ
MM
NA
NR
NP
NL
NC
NZ
NI
NE
NG
NU
NF
MP
NO
OM
PK
PW
PS
PA
PG
PY
PE
PH
PN
PL
PT
PR
QA
RE
RO
RU
RW
BL
SH
KN
LC
MF
PM
VC
WS
SM
ST
SA
SN
RS
SC
SL
SG
SX
SK
SI
SB
SO
ZA
GS
SS
ES
LK
SD
SR
SJ
SZ
SE
CH
SY
TW
TJ
TZ
TH
TL
TG
TK
TO
TT
TN
TR
TM
TC
TV
UG
UA
AE
GB
US
UM
UY
UZ
VU
VE
VN
VG
VI
WF
EH
YE
ZM
ZW

SegmentCurrency

Value Description
AED
AFN
ALL
AMD
ANG
AOA
ARS
AUD
AWG
AZN
BAM
BBD
BDT
BGN
BHD
BIF
BMD
BND
BOB
BRL
BSD
BTN
BWP
BYR
BZD
CAD
CDF
CHF
CLP
CNY
COP
CRC
CUC
CUP
CVE
CZK
DJF
DKK
DOP
DZD
EGP
ERN
ETB
EUR
FJD
FKP
GBP
GEL
GGP
GHS
GIP
GMD
GNF
GTQ
GYD
HKD
HNL
HRK
HTG
HUF
IDR
ILS
IMP
INR
IQD
IRR
ISK
JEP
JMD
JOD
JPY
KES
KGS
KHR
KMF
KPW
KRW
KWD
KYD
KZT
LAK
LBP
LKR
LRD
LSL
LYD
MAD
MDL
MGA
MKD
MMK
MNT
MOP
MRO
MUR
MVR
MWK
MXN
MYR
MZN
NAD
NGN
NIO
NOK
NPR
NZD
OMR
PAB
PEN
PGK
PHP
PKR
PLN
PYG
QAR
RON
RSD
RUB
RWF
SAR
SBD
SCR
SDG
SEK
SGD
SHP
SLL
SOS
SPL
SRD
STD
SVC
SYP
SZL
THB
TJS
TMT
TND
TOP
TRY
TTD
TVD
TWD
TZS
UAH
UGX
USD
UYU
UZS
VEF
VND
VUV
WST
XAF
XCD
XDR
XOF
XPF
YER
ZAR
ZMW
ZWD

SegmentFilterComparison

Value Description
GreaterThan
LessThan
EqualTo
NotEqualTo
GreaterThanOrEqual
LessThanOrEqual
Exists
Contains
NotContains

SegmentLoginIdentityProvider

Value Description
Unknown
PlayFab
Custom
GameCenter
GooglePlay
Steam
XBoxLive
PSN
Kongregate
Facebook
IOSDevice
AndroidDevice
Twitch
WindowsHello
GameServer
CustomServer
NintendoSwitch
FacebookInstantGames
OpenIdConnect
Apple
NintendoSwitchAccount
GooglePlayGames

SegmentModel

Name Type Description
Description

string

Segment description.

EnteredSegmentActions

SegmentTrigger[]

Segment actions for current entered segment players.

LastUpdateTime

string

Segment last updated date time.

LeftSegmentActions

SegmentTrigger[]

Segment actions for current left segment players.

Name

string

Segment name.

SegmentId

string

Segment id in hex.

SegmentOrDefinitions

SegmentOrDefinition[]

Segment or definitions. This includes segment and definitions and filters.

SegmentOrDefinition

Name Type Description
SegmentAndDefinitions

SegmentAndDefinition[]

List of segment and definitions.

SegmentPushNotificationDevicePlatform

Value Description
ApplePushNotificationService
GoogleCloudMessaging

SegmentTrigger

Name Type Description
AddInventoryItemsV2Action

AddInventoryItemsV2SegmentAction

Add inventory item v2 segment trigger action.

BanPlayerAction

BanPlayerSegmentAction

Ban player segment trigger action.

DeleteInventoryItemsV2Action

DeleteInventoryItemsV2SegmentAction

Delete inventory item v2 segment trigger action.

DeletePlayerAction

DeletePlayerSegmentAction

Delete player segment trigger action.

DeletePlayerStatisticAction

DeletePlayerStatisticSegmentAction

Delete player statistic segment trigger action.

EmailNotificationAction

EmailNotificationSegmentAction

Email notification segment trigger action.

ExecuteAzureFunctionAction

ExecuteAzureFunctionSegmentAction

Execute azure function segment trigger action.

ExecuteCloudScriptAction

ExecuteCloudScriptSegmentAction

Execute cloud script segment trigger action.

GrantItemAction

GrantItemSegmentAction

Grant item segment trigger action.

GrantVirtualCurrencyAction

GrantVirtualCurrencySegmentAction

Grant virtual currency segment trigger action.

IncrementPlayerStatisticAction

IncrementPlayerStatisticSegmentAction

Increment player statistic segment trigger action.

PushNotificationAction

PushNotificationSegmentAction

Push notification segment trigger action.

SubtractInventoryItemsV2Action

SubtractInventoryItemsV2SegmentAction

Subtract inventory item v2 segment trigger action.

StatisticSegmentFilter

Name Type Description
Comparison

SegmentFilterComparison

Statistic filter comparison.

FilterValue

string

Statistic filter value.

Name

string

Statistic name.

UseCurrentVersion

boolean

Use current version of statistic?

Version

number

Statistic version.

SubtractInventoryItemsV2SegmentAction

Name Type Description
Amount

number

Amount of the item to removed from the player

CollectionId

string

The collection id for where the item will be removed from the player inventory

DurationInSeconds

number

The duration in seconds to be removed from the subscription in the players inventory

ItemId

string

The id of item to be removed from the player

StackId

string

The stack id for where the item will be removed from the player inventory

TagSegmentFilter

Name Type Description
Comparison

SegmentFilterComparison

Tag comparison.

TagValue

string

Tag value.

TotalValueToDateInUSDSegmentFilter

Name Type Description
Amount

string

Total value to date USD amount.

Comparison

SegmentFilterComparison

Total value to date USD comparison.

UpdateSegmentRequest

Update segment properties data which are planning to update

Name Type Description
SegmentModel

SegmentModel

Segment model with all of the segment properties data.

UpdateSegmentResponse

Name Type Description
ErrorMessage

string

Error message.

SegmentId

string

Segment id.

UserOriginationSegmentFilter

Name Type Description
LoginProvider

SegmentLoginIdentityProvider

User login provider.

ValueToDateSegmentFilter

Name Type Description
Amount

string

Value to date amount.

Comparison

SegmentFilterComparison

Value to date comparison.

Currency

SegmentCurrency

Currency using for filter.

VirtualCurrencyBalanceSegmentFilter

Name Type Description
Amount

number

Total amount.

Comparison

SegmentFilterComparison

Amount comparison.

CurrencyCode

string

Currency code.

Error Codes

Name Code
InvalidSegment 1242
NameNotAvailable 1058
SegmentManagementInvalidInput 10005
SegmentManagementInvalidSegmentId 10004
SegmentManagementInvalidSegmentName 10006
SegmentManagementNoExpressionTree 10001
SegmentManagementSegmentCountOverLimit 10003
SegmentManagementTriggerActionCountOverLimit 10002
UnknownError 1039
UpdateSegmentRateLimitExceeded 10009