groups

groups.ban

Adds a user or a group to the community blacklist.

To call this method, you can use:
• user access token obtained in the standalone app through Implicit Flow (access right required: groups — this is issued in exceptional cases by a request to support at devsupport@corp.vk.com)

Parameters

group_id

integer

Community ID.

Required parameter

owner_id

integer

Community or user ID to be added to the blacklist.

Use a negative value to designate a community ID. For example owner_id = -1 corresponds to VKontakte API (club1) community ID.

end_date

positive

Ban expiration date in Unixtime format. The maximum possible value, which can be specified, is one year from the beginning.

If the parameter is not specified, the user will be added to blacklist forever.

reason

positive

Ban reason:

  • 0 — Other (by default);
  • 1 — Spam;
  • 2 — Harassment;
  • 3 — Profanity;
  • 4 — Irrelevant messages.
comment

string

Text of the comment to the ban.

comment_visible

checkbox

1 — comment is visible to a blacklisted user; 0 — comment is not visible to a blacklisted user (by default).

Result

Returns 1 if succeeded.

Error codes

Common errors may occur during execution