Characters - Update Character Statistics

Updates the values of the specified title-specific statistics for the specific character. By default, clients are not permitted to update statistics. Developers may override this setting in the Game Manager > Settings > API Features.

POST https://titleId.playfabapi.com/Client/UpdateCharacterStatistics

Request Header

Name Required Type Description
X-Authorization True

string

This API requires a client session ticket, available from any Client Login function.

Request Body

Name Required Type Description
CharacterId True

string

Unique PlayFab assigned ID for a specific character owned by a user

CharacterStatistics

object

Statistics to be updated with the provided values, in the Key(string), Value(int) pattern.

CustomTags

object

The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).

Responses

Name Type Description
200 OK

UpdateCharacterStatisticsResult

400 Bad Request

ApiErrorWrapper

This is the outer wrapper for all responses with errors

Security

X-Authorization

This API requires a client session ticket, available from any Client Login function.

Type: apiKey
In: header

Definitions

Name Description
ApiErrorWrapper

The basic wrapper around every failed API response

UpdateCharacterStatisticsRequest

Enable this option with the 'Allow Client to Post Player Statistics' option in PlayFab GameManager for your title. However, this is not best practice, as this data will no longer be safely controlled by the server. This operation is additive. Character Statistics not currently defined will be added, while those already defined will be updated with the given values. All other user statistics will remain unchanged. Character statistics are used by the character-leaderboard apis, and accessible for custom game-logic.

UpdateCharacterStatisticsResult

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

UpdateCharacterStatisticsRequest

Enable this option with the 'Allow Client to Post Player Statistics' option in PlayFab GameManager for your title. However, this is not best practice, as this data will no longer be safely controlled by the server. This operation is additive. Character Statistics not currently defined will be added, while those already defined will be updated with the given values. All other user statistics will remain unchanged. Character statistics are used by the character-leaderboard apis, and accessible for custom game-logic.

Name Type Description
CharacterId

string

Unique PlayFab assigned ID for a specific character owned by a user

CharacterStatistics

object

Statistics to be updated with the provided values, in the Key(string), Value(int) pattern.

CustomTags

object

The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).

UpdateCharacterStatisticsResult

Error Codes

Name Code
APINotEnabledForGameClientAccess 1082
CharacterNotFound 1135
InvalidCharacterStatistics 1138