Skip to content

removeUserVerification

Returns: TrueOfficial docs ↗

Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns True on success.

Parameters

user_idIntegerRequired
Unique identifier of the target user

Returns

On success, True is returned.

GramIO Usage

ts
// Remove verification from a user by their numeric ID
await 
bot
.
api
.
removeUserVerification
({
user_id
: 123456789 });
ts
// Remove verification when a user triggers a command
bot
.
command
("unverify", async (
ctx
) => {
if (!
ctx
.
from
) return;
await
bot
.
api
.
removeUserVerification
({
user_id
:
ctx
.
from
.
id
});
await
ctx
.
reply
("Your verification has been removed.");
});
ts
// Remove verification for a specific user passed as a command argument
bot
.
command
("unverifyuser", async (
ctx
) => {
const
userId
=
Number
(
ctx
.
args
);
if (!
userId
||
isNaN
(
userId
)) return
ctx
.
reply
("Usage: /unverifyuser <user_id>");
await
bot
.
api
.
removeUserVerification
({
user_id
:
userId
});
await
ctx
.
reply
(`Verification removed from user ${
userId
}.`);
});

Errors

CodeErrorCause
400Bad Request: user not founduser_id does not exist or the bot has never interacted with this user
400Bad Request: USER_NOT_VERIFIEDThe target user is not currently verified by this organization — check before calling
403Forbidden: not enough rightsThe bot's organization does not have third-party verification rights granted by Telegram
429Too Many Requests: retry after NRate limit hit — check retry_after and use the auto-retry plugin

Tips & Gotchas

  • Only for approved verification organizations. This method is part of Telegram's third-party verification system. The bot must belong to an organization that Telegram has explicitly granted the ability to verify users. Regular bots cannot use this.
  • Track verified users yourself. There is no API method to query which users your organization has verified. Maintain a list in your database to avoid calling removeUserVerification on users who aren't verified.
  • user_id must be numeric. Unlike chat_id, user IDs cannot be specified as @username strings — always use the numeric integer ID.
  • Re-verification is possible. After removing verification, you can call verifyUser again at any time to re-grant the checkmark.

See Also