users.profile.get
Retrieve a user's profile information, including their custom status.
Facts
Method URL: | https://slack.com/api/users.profile.get | ||||||
---|---|---|---|---|---|---|---|
Preferred HTTP method: | GET | ||||||
Accepted content types: | application/x-www-form-urlencoded | ||||||
Rate limiting: | Tier 4 | ||||||
Works with: |
|
Use this method to retrieve a user's profile information.
Arguments
token
Authentication token bearing required scopes. Tokens should be passed as an HTTP Authorization header or alternatively, as a POST parameter.
Examplexxxx-xxxxxxxxx-xxxx
include_labels
Include labels for each ID in custom profile fields. Using this parameter will heavily rate-limit your requests and is not recommended.
Default: false
true
user
User to retrieve profile info for
ExampleW1234567890
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
. Using the include_labels
parameter will severely rate-limit requests to this method.
Response
The response contains a profile
item with an array of key:value pairs.
Common successful response
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"
}
}
Common error response
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.
Email addresses
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.
If the Email Display setting is unchecked in your Slack Admin settings, users.profile.get
does not return an email
value.
Errors
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. |
not_allowed_token_type | The token type used in this request is not allowed. |
method_deprecated | The method has been deprecated. |
deprecated_endpoint | The endpoint has been deprecated. |
two_factor_setup_required | Two factor setup is required. |
enterprise_is_restricted | The method cannot be called from an Enterprise. |
is_bot | This method cannot be called by a bot user. |
invalid_arguments | The method was either called with invalid arguments or some detail about the arguments passed are invalid, which is more likely when using complex arguments like blocks or attachments. |
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_array_arg | The method was passed an array as an argument. Please only input valid strings. |
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. |
ratelimited | The request has been ratelimited. Refer to the |
accesslimited | Access to this method is limited on the current network |
request_timeout | The method was called via a |
service_unavailable | The service is temporarily unavailable |
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. |
internal_error | The server could not complete your operation(s) without encountering an error, likely due to a transient issue on our end. It's possible some aspect of the operation succeeded before the error was raised. |
Warnings
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 |