Skip to main content
PUT
Update traits
Sets and deletes traits on the profile of one identified player. Traits are the data that describes a player; event data stays “properties”. Keys that you do not send keep their values. The response returns the merged traits, so you do not need a second read.

Authentication

Use an API key (mana_api_...) with the profiles:write scope. See Authentication.
  • The key works on its own project only. Another project’s key gets 404.
  • The key’s creator must be an owner, admin or editor.
  • Call it from a server. A request with a browser Origin header gets 403.
Editors can also change traits on the profile’s Traits tab.

Path parameters

This endpoint writes user traits only, so an anon: key gets 400: identify the player first. Anonymous traits come from a traits event without a user_id. If no profile exists for the user_id, the write creates it.

Body

A flat object of traits. Send 1 to 50 keys, at most 8 KB as JSON. The whole body is at most 16 KB. Known traits such as discord_id and steam_id must be strings and pass a light format check. Any other key is a custom trait. This endpoint is a trusted channel, so it can set the protected traits (email, itch_user_id, stripe_customer_id and paddle_customer_id). A game or website cannot set them.

Response

200:
Reports, the Players page, and GET reads show the write after a few seconds.

Delete a trait

Send null. Set and delete can go in the same request:
A Discord bot or your website links a player to a Discord account with one call:
To unlink, send { "discord_id": null, "discord": null }. Keep the key in server-side secrets.

Errors

PUT is idempotent: you can retry the same body after a 429 or a 5xx.

Authorizations

Authorization
string
header
required

An API key (mana_api_...) with scopes. It reads reports and writes player traits.

Path Parameters

projectId
string<uuid>
required

The project ID

playerKey
string
required

The player key of an identified player: user: and the user ID that you send with identify (1 to 255 characters). URL-encode it, for example user%3Aplayer-42.

Required string length: 6 - 260
Pattern: ^user:

Body

application/json

1 to 50 traits, at most 8 KB as JSON. A value is a string (at most 1024 characters), a number, a boolean, or null to delete the trait. user_id is reserved.

{key}
Maximum string length: 1024

Response

The player traits after the write

player_key
string
required

user: and the user ID

user_id
string
required
traits
object
required

The user traits read before the write, with this update merged in

set
string[]
required

The keys that this request set

deleted
string[]
required

The keys that this request deleted

updated_at
string
required

The time of the write (ISO 8601)