> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hyperx.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Character Data

> Save and load runtime data attached to a character.

Character Data belongs to a character owned by the current user. Use it for values that differ per playable character, such as level, equipment, stats, and loadout.

The representative character is only the profile/default convenience target. Games with multiple playable characters can pass `characterId` explicitly and do not need to update the representative character every time the player switches characters.

For account-wide currency, achievements, or settings, use user data from [Data Management](/guide/en/dotnet/data-management).

## Setup

1. Create a character data table in Console.
2. Define the fields and types.
3. Sign in a user and keep the target character ID available in the client.

## Save

To save data for the representative character, use the existing convenience method.

```cs theme={null}
await player.SaveCharacterData(
    "character_status",
    new { level = 12, power = 3400 }
);
```

To save data for a specific character, pass the character ID.

```cs theme={null}
var character = await player.CreateCharacter(name: "Ari");

await player.SaveCharacterDataForCharacter(
    character.Id,
    "character_status",
    new { level = 12, power = 3400 }
);
```

The payload must match the Console schema. Unknown fields or wrong types are rejected.

```cs theme={null}
var data = HyperX.Json.JsonMapper.ToObject("{\"level\":12,\"power\":3400}");
await player.SaveCharacterDataForCharacter(character.Id, "character_status", data);
```

## Load

Representative character data:

```cs theme={null}
var status = await player.GetCharacterData("character_status");

if (status.Exists)
{
    int level = (int)status.Data["level"];
    int power = (int)status.Data["power"];
}
```

Specific character data:

```cs theme={null}
var status = await player.GetCharacterDataForCharacter(
    character.Id,
    "character_status"
);
```

The response includes existence, schema version, and JSON payload.

## Tips

* Keep the selected character ID in your character selection UI and pass it to `SaveCharacterDataForCharacter` and `GetCharacterDataForCharacter`.
* Update the representative character only when you want profile, search, or friend views to show a different character.
* Keep Console schemas and client models aligned.
* Store searchable gameplay metrics in purpose-built features such as rankings, groups, or game logs.
