Use this method to retrieve a user's profile information.
Argument | Example | Required | Description |
---|---|---|---|
token | xxxx-xxxxxxxxx-xxxx |
Required | Authentication token bearing required scopes. |
include_labels | true |
Optional, default=false | Include labels for each ID in custom profile fields |
user | W1234567890 |
Optional | User to retrieve profile info for |
application/x-www-form-urlencoded
querystring or POST body. This method does not currently accept application/json
.
If you're frequently calling users.profile.get
on behalf of a team or user, we recommend caching labels retrieved from team.profile.get
. Please only use the include_labels
parameter with users.profile.get
sparingly.
The include_labels
parameter is heavily rate-limited.
The response contains a profile
item with an array of key:value pairs.
Typical success response
{
"ok": true,
"profile": {
"avatar_hash": "ge3b51ca72de",
"status_text": "Print is dead",
"status_emoji": ":books:",
"status_expiration": 0,
"real_name": "Egon Spengler",
"display_name": "spengler",
"real_name_normalized": "Egon Spengler",
"display_name_normalized": "spengler",
"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"
}
}
Typical error response
{
"ok": false,
"error": "user_not_found"
}
We hope you find the first_name
, last_name
, email
attributes self-explanatory.
The user's custom-set "current status" can be found in the status_text
and status_emoji
attributes. If the status is set to automatically expire, the status_expiration
field provides the specific time in seconds since the epoch (UNIX time). See custom status for more info. status_expiration
set to 0
indicates the status does not expire.
The image_
keys hold links to the different sizes we support for the user's profile image from 24x24 to 1024x1024 pixels. A link to the image in its original size is stored in image_original
.
Bot users may contain an always_active
profile field, indicating whether the bot user is active in a way that overrides traditional presence rules. The presence docs tell the whole story.
For a description of the fields
key, see the users.profile.set method.
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.
Apps created after January 4th, 2017 must request both the users:read
and users:read.email
OAuth permission scopes simultaneously when using the OAuth app installation flow to enable access to the email
field of user objects returned by this method.
This table lists the expected errors that this method could return.
However, other errors can be returned in the case where the service is down
or other unexpected factors affect processing. Callers should always
check the value of the ok
params in the response.
Error | Description |
---|---|
user_not_found |
Value passed for |
not_authed |
No authentication token provided. |
invalid_auth |
Some aspect of authentication cannot be validated. Either the provided token is invalid or the request originates from an IP address disallowed from making the request. |
account_inactive |
Authentication token is for a deleted user or workspace. |
token_revoked |
Authentication token is for a deleted user or workspace or the app has been removed. |
no_permission |
The workspace token used in this request does not have the permissions necessary to complete the request. Make sure your app is a member of the conversation it's attempting to post a message to. |
org_login_required |
The workspace is undergoing an enterprise migration and will not be available until migration is complete. |
ekm_access_denied |
Administrators have suspended the ability to post a message. |
missing_scope |
The token used is not granted the specific scope permissions required to complete this request. |
is_bot |
This method cannot be called by a bot user. |
invalid_arguments |
The method was called with invalid arguments. |
invalid_arg_name |
The method was passed an argument whose name falls outside the bounds of accepted or expected values. This includes very long names and names with non-alphanumeric characters other than |
invalid_charset |
The method was called via a |
invalid_form_data |
The method was called via a |
invalid_post_type |
The method was called via a |
missing_post_type |
The method was called via a |
team_added_to_org |
The workspace associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete. |
request_timeout |
The method was called via a |
fatal_error |
The server could not complete your operation(s) without encountering a catastrophic error. It's possible some aspect of the operation succeeded before the error was raised. |
This table lists the expected warnings that this method will return. However, other warnings can be returned in the case where the service is experiencing unexpected trouble.
Warning | Description |
---|---|
missing_charset | The method was called via a |
superfluous_charset | The method was called via a |