Xsolla-logo

Update user’s attributes from serverServer-side

post/attributes/users/{user_id}/update

Updates and creates user’s attributes.

Notice
Rate limits for server-side methods are applied to this method.

SecurityAttributesServer
Request
path Parameters
user_id
required
string <uuid>

User ID. You can find it in Publisher Account > Login settings > Users > Username/ID.

Request Body schema: application/json
publisher_id
required
integer or null

Your merchant ID the request is made for. Needed for request authorizing.

Array of objects

List of attributes of the specified game. To add attribute which does not exist, set this attribute to the key parameter. To update value of the attribute, specify its key parameter and set new value. You can change several attributes at a time.

Array
key
required
string <= 256 characters [A-Za-z0-9_]+

Name of attribute that is used to identify user’s attribute. Must be unique per user.

value
required
string <= 256 characters

Value of user’s attribute.

attr_type
string
Default: "client"

Definition of user’s access level to service attributes:

  • client - A user-editable attribute. The values for this type of attributes are entered by a user or specified according to the in-game logics on the client side. For example, the name and character stats, game difficulty level, etc.
  • server - A read-only attribute. The values for this type of attributes are entered and edited on the server side of your application. We recommend that you use them for configuration of game character stats or user parameters that shouldn’t change regularly. For example, chance to get a bonus, game character key parameters, user categories, etc.
Enum: "client" "server"
data_type
string or null

Data type of attribute

Enum: "string" "number" "integer" "boolean"
description
string or null

Description of attribute from JSON Schema.

format
string or null

Format of attribute from JSON Schema. Can be date-time, date, time, duration, email, uri, uuid or other from JSON Schema specification

permission
string or null

Definition of user’s access level to other users’ attributes.

Enum: "public" "private"
publisher_project_id
integer

Project ID from Publisher Account which you want to update the value of specified attributes for. If you do not specify it, the method updates attributes that are general to all games only.

removing_keys
Array of strings

List of attributes which you want to delete. If you specify the same attribute in attributes parameter, it will not be deleted.

Responses
204

No Content

400

Bad Request

403

Forbidden

422

Unprocessable Entity

429

Too Many Requests

Request samples
application/json
{
  • "attributes": [
    ],
  • "publisher_id": 0,
  • "publisher_project_id": 0,
  • "removing_keys": [
    ]
}
Response samples
{
  • "error": {
    }
}