User

Update a user

You can update information about a user using this API. In addition to changing a user's nickname or profile image, you can issue a new access token for the user. The new access token replaces the previous one as the necessary token for authentication.

You can also deactivate or reactivate a user using this API request. If the leave_all_when_deactivated is set to true, a user leaves all joined group channels and becomes deactivated.

Note: Issuing session tokens through the /users/{user_id} endpoint is now deprecated and it's replaced with <code>/users/{user_id}/token</code> endpoint for greater efficiency. For those who are currently using the old endpoint, you can start issuing tokens using the new endpoint.

https://sendbird.com/docs/chat/platform-api/v3/user/managing-users/update-a-user#1-update-a-user

put/v3/users/{user_id}

Request

  • Base URL
    https://api-APP_ID.sendbird.com
  • Auth
    none declared

Path parameters

user_idstring required

(Required)

Headers

api-tokenstring
Example:{{API_TOKEN}}

Request body

discovery_keysstring[] nullable
is_activeboolean
issue_access_tokenboolean
last_seen_atinteger
leave_all_when_deactivatedboolean
nicknamestring nullable
preferred_languagesstring[] nullable
profile_filestring binary
profile_urlstring nullable

Response

Successful response

access_tokenstring
created_atinteger
discovery_keysstring[] nullable
has_ever_logged_inboolean
is_activeboolean
is_hide_me_from_friendsboolean
is_onlineboolean
is_shadow_blockedboolean
last_seen_atinteger
localestring
metadataobject nullable
nicknamestring nullable
preferred_languagesstring[] nullable
profile_urlstring
require_auth_for_profile_imageboolean
user_idstring required
state'' | 'invited' | 'joined' nullable
unread_channel_countinteger
unread_message_countinteger
phone_numberstring
is_createdboolean

Example response

{
  "metadata": "{}",
  "is_active": true,
  "preferred_languages": [
    "preferred_languages",
    "preferred_languages"
  ],
  "require_auth_for_profile_image": true,
  "unread_channel_count": 6,
  "discovery_keys": [
    "discovery_keys",
    "discovery_keys"
  ],
  "profile_url": "profile_url",
  "is_created": true,
  "created_at": 9,
  "has_ever_logged_in": true,
  "locale": "locale",
  "unread_message_count": 8,
  "access_token": "access_token",
  "is_shadow_blocked": true,
  "user_id": "user_id",
  "nickname": "nickname",
  "phone_number": "phone_number",
  "is_online": true,
  "state": "",
  "is_hide_me_from_friends": true,
  "last_seen_at": 9
}

Changes

    • info

      the request property became nullable

    • info

      the request property became nullable

    • info

      the request property became nullable

    • info

      the request property became nullable

    • warning

      deleted the header request parameter Api-Token

    • warning

      removed the request property

    • warning

      removed the request property

    • warning

      removed the request property

    • info

      api operation id updateUserById removed and replaced with updateAUser

    • info

      added the new optional header request parameter api-token