// create a new user, if the user already exists an error is returned
const userData = new Dictionary<string, object>
{
{"name", "John Doe" },
{"occupation", "Software Engineer"},
{"gender", "male"},
};
await client.Users.AddAsync("john-doe", userData);
// get or create a new user, if the user already exists the user is returned
await client.Users.AddAsync("john-doe", userData, true);Adding Users
This endpoint allows you to insert a new user.
| Name | Type | Description |
|---|---|---|
| id | string | The unique identifier for the new user (eg. username, user id, etc.). The value is restricted to alphanumeric characters, dashes and underscore symbols. |
| data | object | The data related to the user. |
// create a new user, if the user already exists an error is returned
client.user("john-doe").create(new Data()
.set("name", "John Doe")
.set("occupation", "Software Engineer")
.set("gender", "male")).join();
// get or create a new user, if the user already exists the user is returned
client.user("john-doe").getOrCreate(new Data()
.set("name", "John Doe")
.set("occupation", "Software Engineer")
.set("gender", "male")).join();