user type
A user object contains information about a Slack workspace user.
If you develop for Enterprise Grid, there's a lot to consider about the most important field in a user object: the id
or user_id
. Learn more about global IDs and migration.
Example
{
"ok": true,
"user": {
"id": "W012A3CDE",
"team_id": "T012AB3C4",
"name": "spengler",
"deleted": false,
"color": "9f69e7",
"real_name": "Egon Spengler",
"tz": "America/New_York",
"tz_label": "Eastern Daylight Time",
"tz_offset": -14400,
"profile": {
"title": "",
"phone": "",
"skype": "",
"real_name": "Egon Spengler",
"real_name_normalized": "Egon Spengler",
"display_name": "spengler",
"display_name_normalized": "spengler",
"status_text": "Print is dead",
"status_emoji": ":books:",
"status_expiration": 1502138999,
"avatar_hash": "ge3b51ca72de",
"first_name": "Matthew",
"last_name": "Johnston",
"email": "spengler@ghostbusters.example.com",
"image_original": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
"image_24": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
"image_32": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
"image_48": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
"image_72": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
"image_192": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
"image_512": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
"team": "T012AB3C4"
},
"is_admin": true,
"is_owner": false,
"is_primary_owner": false,
"is_restricted": false,
"is_ultra_restricted": false,
"is_bot": false,
"is_stranger": false,
"updated": 1502138686,
"is_app_user": false,
"is_invited_user": false,
"has_2fa": false,
"locale": "en-US"
}
}
Common fields
The composition of user objects can vary greatly depending on the API being used, or the context of each Slack workspace. Data that has not been supplied may not be present at all, may be null
, or may contain an empty string.
Therefore, consider the following a non-exhaustive list of potential user object fields you might encounter.
Field | Type | Description |
---|---|---|
always_active |
Boolean | Indicates that a bot user is set to be constantly active in presence status. |
color |
String | Used in some clients to display a special username color. |
deleted |
Boolean | This user has been deactivated when the value of this field is true . Otherwise the value is false , or the field may not appear at all. |
enterprise_user |
Object | An object containing info related to an Enterprise Grid user. See our Enterprise grid documentation for more detail. |
enterprise_user.enterprise_id |
String | A unique ID for the Enterprise Grid organization this user belongs to. |
enterprise_user.enterprise_name |
String | A display name for the Enterprise Grid organization. |
enterprise_user.id |
String | This user's ID - some Grid users have a kind of dual identity — a local, workspace-centric user ID as well as a Grid-wise user ID, called the Enterprise user ID. In most cases these IDs can be used interchangeably, but when it is provided, we strongly recommend using this Enterprise user id over the root level user id field. |
enterprise_user.is_admin |
Boolean | Indicates whether the user is an Admin of the Enterprise Grid organization. |
enterprise_user.is_owner |
Boolean | Indicates whether the user is an Owner of the Enterprise Grid organization. |
enterprise_user.teams |
String[] | An array of workspace IDs that are in the Enterprise Grid organization. |
has_2fa |
Boolean | Describes whether two-factor authentication is enabled for this user. |
id |
String | Identifier for this workspace user. It is unique to the workspace containing the user. Use this field together with team_id as a unique key when storing related data or when specifying the user in API requests. We recommend considering the format of the string to be an opaque value, and not to rely on a particular structure. |
is_admin |
Boolean | Indicates whether the user is an Admin of the current workspace. |
is_app_user |
Boolean | Indicates whether the user is an authorized user of the calling app. |
is_bot |
Boolean | Indicates whether the user is actually a bot user. Bleep bloop. |
is_invited_user |
Boolean | Indicates whether the user signed up for the workspace directly (false or the field is absent), or they joined via an invite (true ). |
is_owner |
Boolean | Indicates whether the user is an Owner of the current workspace. |
is_primary_owner |
Boolean | Indicates whether the user is the Primary Owner of the current workspace. |
is_restricted |
Boolean | Indicates whether or not the user is a guest user. Use in combination with the is_ultra_restricted field to check if the user is a single-channel guest user. |
is_stranger |
Boolean | If true , this user belongs to a different workspace than the one associated with your app's token, and isn't in any shared channels visible to your app. If false (or this field is not present), the user is either from the same workspace as associated with your app's token, or they are from a different workspace, but are in a shared channel that your app has access to. Read our shared channels docs for more detail. |
is_ultra_restricted |
Boolean | Indicates whether or not the user is a single-channel guest. |
locale |
String | Contains a IETF language code that represents this user's chosen display language for Slack clients. Useful for localizing your apps. |
name |
String | Don't use this. It once indicated the preferred username for a user, but that behavior has fundamentally changed since. |
profile |
Object | An object containing the default fields of a user's workspace profile. A user's custom profile fields may be discovered using users.profile.get . |
profile.display_name_normalized |
String | The display_name field, but with any non-Latin characters filtered out. |
profile.display_name |
String | Indicates the display name that the user has chosen to identify themselves by in their workspace profile. Do not use this field as a unique identifier for a user, as it may change at any time. Instead, use id and team_id in concert. |
profile.image_* |
String | These various fields will contain https URLs that point to square ratio, web-viewable images (GIFs, JPEGs, or PNGs) that represent different sizes of a user's profile picture. |
profile.real_name_normalized |
String | The real_name field, but with any non-Latin characters filtered out. |
profile.real_name |
String | The real name that the user specified in their workspace profile. |
two_factor_type |
Enum (String) | Indicates the type of two-factor authentication in use. Only present if has_2fa is true . The value will be either app or sms . |
tz |
String | A human-readable string for the geographic timezone-related region this user has specified in their account. |
tz_label |
String | Describes the commonly used name of the tz timezone. |
tz_offset |
Integer | Indicates the number of seconds to offset UTC time by for this user's tz . |
updated |
String | A unix timestamp indicating when the user object was last updated. |
The users:read.email
OAuth scope is now required to access the email
field in user objects returned by the users.list
and users.info
web API methods. users:read
is no longer a sufficient scope for this data field. Learn more.