Skip to content

removeBusinessAccountProfilePhoto

Returns: TrueOfficial docs ↗

Removes the current profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success.

Parameters

business_connection_idStringRequired
Unique identifier of the business connection
is_publicBooleanOptional
Pass True to remove the public photo, which is visible even if the main photo is hidden by the business account's privacy settings. After the main photo is removed, the previous profile photo (if present) becomes the main photo.

Returns

On success, True is returned.

GramIO Usage

Remove the main (private) profile photo of a managed business account:

ts
async function 
removeMainPhoto
(
businessConnectionId
: string) {
const
success
= await
bot
.
api
.
removeBusinessAccountProfilePhoto
({
business_connection_id
:
businessConnectionId
,
});
console
.
log
("Main photo removed:",
success
);
}

Remove the public profile photo that is visible despite privacy restrictions:

ts
async function 
removePublicPhoto
(
businessConnectionId
: string) {
await
bot
.
api
.
removeBusinessAccountProfilePhoto
({
business_connection_id
:
businessConnectionId
,
is_public
: true,
}); }

Remove both photos in sequence — public first, then main:

ts
async function 
clearAllPhotos
(
businessConnectionId
: string) {
// Remove the publicly visible photo await
bot
.
api
.
removeBusinessAccountProfilePhoto
({
business_connection_id
:
businessConnectionId
,
is_public
: true,
}); // Remove the main photo await
bot
.
api
.
removeBusinessAccountProfilePhoto
({
business_connection_id
:
businessConnectionId
,
is_public
: false,
}); }

Listen for a command and reset the business account photo on demand:

ts
bot
.
command
("reset_photo", async (
ctx
) => {
const
connectionId
= "your_business_connection_id";
await
bot
.
api
.
removeBusinessAccountProfilePhoto
({
business_connection_id
:
connectionId
,
}); await
ctx
.
send
("Business profile photo has been removed.");
});

Errors

CodeErrorCause
400Bad Request: business connection not foundThe business_connection_id is invalid or the connection has been revoked.
400Bad Request: not enough rightsThe business bot connection does not have the can_edit_profile_photo right. Enable it in BotFather's business bot settings.
400Bad Request: no profile photoThere is no profile photo of the specified type (main or public) to remove.
403Forbidden: not enough rightsThe bot is not authorized to manage this business account's profile.
429Too Many Requests: retry after NFlood control triggered. Wait N seconds before retrying.

Tips & Gotchas

  • Two independent photo slots. A business account can have a "main" photo and a separate "public" photo. The main photo is shown based on the account's privacy settings; the public photo is always visible. Pass is_public: true to remove the public slot, omit it (or pass false) for the main slot.
  • Removing the main photo reveals the previous one. If the business account had multiple photos uploaded, deleting the current main photo promotes the previous photo in the history to become the new main. To fully clear the profile you may need multiple calls.
  • can_edit_profile_photo is a business-specific right. It is separate from all other business bot rights. Verify it is granted by inspecting getBusinessConnection before calling this method in production.
  • No undo. There is no method to "restore" a removed photo from the API. Ensure you have a copy of any important profile images before removing them programmatically.
  • Pair with setBusinessAccountProfilePhoto. Typical workflows remove the old photo and then upload a new one via setBusinessAccountProfilePhoto. Both require can_edit_profile_photo.

See Also