photos.uploadProfilePhoto #

Updates current user profile photo.

The file, video and video_emoji_markup flags are mutually exclusive.

Layer 223

photos.photo#20212ca8 photo:Photo users:Vector<User> = photos.Photo;
---functions---
photos.uploadProfilePhoto#388a3b5 flags:# fallback:flags.3?true bot:flags.5?InputUser file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double video_emoji_markup:flags.4?VideoSize = photos.Photo;

Parameters #

NameTypeDescription
flags#Flags, see TL conditional fields
fallbackflags.3?trueIf set, the chosen profile photo will be shown to users that can't display your main profile photo due to your privacy settings.
botflags.5?InputUserCan contain info of a bot we own, to change the profile photo of that bot, instead of the current user.
fileflags.0?InputFileProfile photo
videoflags.1?InputFileAnimated profile picture video
video_start_tsflags.2?doubleFloating point UNIX timestamp in seconds, indicating the frame of the video/sticker that should be used as static preview; can only be used if video or video_emoji_markup is set.
video_emoji_markupflags.4?VideoSizeAnimated sticker profile picture, must contain either a videoSizeEmojiMarkup or a videoSizeStickerMarkup constructor.

Result #

photos.Photo

Both users and bots can use this method #

Possible errors #

CodeTypeDescription
400ALBUM_PHOTOS_TOO_MANYYou have uploaded too many profile photos, delete some before retrying.
400BOT_INVALIDThis is not a valid bot.
400EMOJI_MARKUP_INVALIDThe specified video_emoji_markup was invalid.
400FILE_PARTS_INVALIDThe number of file parts is invalid.
400IMAGE_PROCESS_FAILEDFailure while processing image.
400PHOTO_CROP_FILE_MISSINGPhoto crop file missing.
400PHOTO_CROP_SIZE_SMALLPhoto is too small.
400PHOTO_EXT_INVALIDThe extension of the photo is invalid.
400PHOTO_FILE_MISSINGProfile photo file missing.
400PHOTO_INVALIDPhoto invalid.
400STICKER_MIME_INVALIDThe specified sticker MIME type is invalid.
400VIDEO_FILE_INVALIDThe specified video file is invalid.

Uploading and Downloading Files #

How to transfer large data batches correctly.

videoSizeEmojiMarkup #

An animated profile picture based on a custom emoji sticker.

videoSizeStickerMarkup #

An animated profile picture based on a sticker.