users.profile.get

Retrieves a user's profile information.

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:
Token typeRequired scope(s)
botusers.profile:read 
userusers.profile:read 

Use this method to retrieve a user's profile information.

Arguments

token

Authentication token bearing required scopes.

Examplexxxx-xxxxxxxxx-xxxx
include_labels

Include labels for each ID in custom profile fields

Default: false

Exampletrue
user

User to retrieve profile info for

ExampleW1234567890

Present arguments as parameters in 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.

Response

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.

Email addresses

Accessing 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.

ErrorDescription
user_not_found

Value passed for user was invalid.

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 _. If you get this error, it is typically an indication that you have made a very malformed API call.

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 POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.

invalid_form_data

The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.

invalid_post_type

The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/json application/x-www-form-urlencoded multipart/form-data text/plain.

missing_post_type

The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.

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 Retry-After header for when to retry the request.

accesslimited

Access to this method is limited on the current network

request_timeout

The method was called via a POST request, but the POST data was either missing or truncated.

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.

WarningDescription
missing_charset

The method was called via a POST request, and recommended practice for the specified Content-Type is to include a charset parameter. However, no charset was present. Specifically, non-form-data content types (e.g. text/plain) are the ones for which charset is recommended.

superfluous_charset

The method was called via a POST request, and the specified Content-Type is not defined to understand the charset parameter. However, charset was in fact present. Specifically, form-data content types (e.g. multipart/form-data) are the ones for which charset is superfluous.

Was this page helpful?