Adding Users

This endpoint allows you to insert a new user.

NameTypeDescription
idstringThe unique identifier for the new user (eg. username, user id, etc.). The value is restricted to alphanumeric characters, dashes and underscore symbols.
dataobjectThe data related to the user.
// create a new user, if the user already exists an error is returned
client.create(user: User(id: "john-doe"), getOrCreate: false) { result in /* ... */ }

// get or create a new user, if the user already exists the user is returned
client.create(user: User(id: "john-doe"), getOrCreate: true) { result in /* ... */ }
© Getstream.io, Inc. All Rights Reserved.