User object

User is an object that refers to a single user in a chat.

Properties

The User object has the following properties:

class User {
id: string,
name?: string,
externalId?: string,
profileUrl?: string,
email?: string,
custom?: ObjectCustom,
status?: string,
type?: string,
updated?: string,
lastActiveTimestamp?: number
}
ParameterTypeDescription
idstringUnique ID of the user.
namestring or undefinedDisplay name or username of the user (must not be empty or consist only of whitespace characters).
externalIdstring or undefinedIdentifier for the user from an external system, such as a third-party authentication provider or a user directory.
profileUrlstring or undefinedURL to the user's profile or avatar image.
emailstring or undefinedUser's email address.
customObjectCustom or undefinedAny custom properties or metadata associated with the user in the form of a JSON. Values must be scalar only; arrays or objects are not supported. App Context filtering language doesn’t support filtering by custom properties.
statusstring or undefinedCurrent status of the user, like online, offline, or away.
typestring or undefinedType of the user, like admin, member, guest.
updatedstring or undefinedTimestamp (a number of seconds since January 1, 1970) for the last time the user information was updated or modified.
lastActiveTimestampnumber or undefinedTimestamp for the last time the user was active in a chat app.
API limits

To learn about the maximum length of parameters used to set user metadata, refer to REST API docs.

Methods

You can call the following methods on the User object.

Click on each method for more details.

Use case

For example, you can use the User object methods to:

Last updated on