Attributes

Set a player's attributes

PUT/v1/attributes

Sets one or more attributes on a player, creating the player on first contact.

An attribute is a fact about the player: their tier, their country, the plan they are on. It describes who they are, not what they have done, and it stays true until you set it to something else.

All or nothing. An unknown key, an attribute that is switched off or a value of the wrong type refuses the whole request and writes none of it; the error names the key. An environment with discovery switched on defines an unknown key from its value instead (a number, a boolean or a string; never a date), and holds it to that type from then on. A number keeps 8 decimal places and up to 20 digits before the point (player_attribute.value_out_of_range past that).

Newer wins. Each value carries occurredAt (or the current time when omitted). A value older than the one stored is answered Stale and ignored, so a sync that delivers an old value after a newer one cannot roll the player back. The same value again is Unchanged and keeps the instant it first became true.

AuthorizationBearer <token>

Paste a project API key (no 'Bearer ' prefix). Create one in the dashboard under API keys.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request body for setting a player's attributes. The project environment is not part of the body: it is resolved from the API key.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/v1/attributes" \  -H "Content-Type: application/json" \  -d '{    "playerId": "string",    "attributes": null  }'
{  "results": {    "property1": "Changed",    "property2": "Changed"  }}