# 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.                                                                                                                            |

```js label="JavaScript"
// create a new user, if the user already exists an error is returned
client.user("john-doe").create({
  name: "John Doe",
  occupation: "Software Engineer",
  gender: "male",
});

// get or create a new user, if the user already exists the user is returned
client.user("john-doe").getOrCreate({
  name: "John Doe",
  occupation: "Software Engineer",
  gender: "male",
});
```


---

This page was last updated at 2026-08-14T17:46:36.156Z.

For the most recent version of this documentation, visit [https://getstream.io/activity-feeds/docs/javascript/v2/users-create/](https://getstream.io/activity-feeds/docs/javascript/v2/users-create/).