Skip to main content

Ban and restrict accounts

Last updated on November 3, 2026

Introduction​

The user ban feature allows you to restrict a user's access to your game or specific features in your game. You can ban players and lift existing bans in the AccelByte Gaming Services (AGS) Admin Portal or with the AGS CLI.

AGS allows you to impose the following banning methods:

  • Account Ban: Revoke the access and refresh tokens of banned players and restrict their access to the platform. An Account Ban has two restrictions:
    • LOGIN: Block the player from logging in at all.
    • GAMEPLAY_BLOCKED: Block the player from gameplay while still allowing them to log in with a minimal set of permissions, such as access to personal data and GDPR-related requests.
  • Feature Ban: Restrict a player's access to a selected feature, such as chat or matchmaking.
  • Device Ban: Block a specific device using its unique ID. Any player who logs in on that device is blocked, regardless of which account they use.
caution

All ban actions, except Device Ban, will revoke existing access tokens.

  • If it's an Account Ban, the refresh_token will also be revoked. This means the user can't use a refresh_token to get a new access token.
    • With the LOGIN restriction, the user also can't log in using their credentials.
    • With the GAMEPLAY_BLOCKED restriction, the user must log in again and receives only a minimal set of permissions. For more information, see Account Ban restrictions.
  • If it's a Feature Ban, the refresh_token will still be valid. This means the user can use the refresh_token to get a new access token that reflects the latest ban state. The AGS Game SDK handles this refresh automatically.
  • If the ban is on the game namespace, it will only affect that game namespace.
  • If the ban is on the publisher namespace, it will affect both the publisher and the game namespace.

Account Ban restrictions​

An Account Ban has two restrictions. Choose the one that matches how much access you want the player to keep.

RestrictionDescription
LOGINPlayer's account is prohibited from logging in to the platform, preventing access to the system entirely, including personal data such as GDPR-related requests.
GAMEPLAY_BLOCKEDPlayer's gameplay access is blocked entirely. Login is still permitted with a basic set of permissions to allow access to personal data, such as GDPR-related requests.

Both restrictions revoke the player's existing access and refresh tokens. With LOGIN, the player can't log in at all. With GAMEPLAY_BLOCKED, the player logs in again and gets a token with a minimal set of permissions. They can't call gameplay APIs, but they can still submit a personal data request or delete their own account.

tip

Ideally, use GAMEPLAY_BLOCKED if you need to honor player privacy requirements, such as GDPR. With it, the player can still log in, so your game client can offer a privacy UI for self-service data access and deletion. With LOGIN, players are blocked entirely from game access, so your support team must handle those requests on the player's behalf.

Your game client could detect GAMEPLAY_BLOCKED after login and route the player to your privacy screens. For more information, see Manage User Data Portability & Erasure. For the game client implementation, see Check whether a player is blocked from gameplay.

Prerequisites​

  • Make sure you have access to the Admin Portal.

  • In Private Cloud, make sure you have the following permissions:

    UsagePermissionsAction
    Ban a playerADMIN:NAMESPACE:{namespace}:BAN:USER:{userId}CREATE
    Enable or disable a player's BanADMIN:NAMESPACE:{namespace}:BAN:USER:{userId}UPDATE
    Retrieve ban types and reasonsADMIN:BANREAD
    View a player's devices and device bansADMIN:NAMESPACE:{namespace}:DEVICEREAD
    Ban a deviceADMIN:NAMESPACE:{namespace}:DEVICECREATE
    Enable or disable a device banADMIN:NAMESPACE:{namespace}:DEVICEUPDATE
  • To follow the AGS CLI steps, you have installed the AGS CLI and signed in with an account that has the permissions above. See Install and sign in. The examples use a Bash shell.

Ban scope​

  • If you ban a player at the publisher namespace level, the ban will apply to all the namespaces in it.

    AGS Public Cloud

    In Public Cloud tier, this applies to the studio namespace, which has the same function as the publisher namespace in the Private Cloud tier.

  • If you ban a player at the game namespace level, the ban only applies to the specific game namespace.

Ban a player by account​

  1. On the Admin Portal sidebar, go to Foundations > Users.

  2. Search for the player you want to ban using the corresponding credentials.

  3. Click View in Action to open the account. The user account details appear.

  4. Click Bans, and then click Add Ban to ban the selected user.

    Image shows the Add Ban option

    The Add Ban settings appear.

Add the user ban details​

  1. Choose the Ban type, and then choose the Restriction.

    Account Ban Details

    If you choose Account Ban, you must choose one of two restrictions: LOGIN or GAMEPLAY_BLOCKED. For more information, see Account Ban restrictions.

    Feature Ban Details

    If you choose Feature Ban, you must choose the feature you want to restrict. A list of the features that players can be banned from can be found in the following table.

    Feature RestrictionDescription
    CHAT_SENDPlayer is banned from sending a message
    CHAT_ALLPlayer is banned from both sending and receiving messages
    ORDER_AND_PAYMENTPlayer is banned from making purchases in-game
    STATISTICSPlayer will not have their statistics recorded
    LEADERBOARDPlayer will not appear on any leaderboards
    MATCHMAKINGPlayer is banned from matchmaking
  2. In Ban Expiration, select one of the following:

    • Set by duration: Enter the number of minutes, hours, or days you want the player to be banned for. The ban expires after this duration.

    • Set by expiration date: Enter the date and time you want the ban to expire.

    • Never: Set a permanent ban.

      Image of the Add Ban form with Account Ban type and LOGIN restriction selected

  3. In Reason, choose a reason for the ban.

    Reason Details

    The following table lists the reasons available for a ban:

    ReasonDescription
    VIOLENCEPlayer is banned for posting violent content
    HARASSMENTPlayer is banned for harassing other players
    HATEFUL_CONDUCTPlayer is banned for acting hatefully towards other players
    OFFENSIVE_USERNAMEPlayer is banned for having an offensive username
    IMPERSONATIONPlayer is banned for impersonating other players
    MALICIOUS_CONTENTPlayer is banned for posting malicious content such as spam, scams, etc.
    SEXUALLY_SUGGESTIVEPlayer is banned for posting sexually explicit or suggestive content
    SEXUAL_VIOLENCEPlayer is banned for acting sexually violent or exploiting other players
    EXTREME_VIOLENCEPlayer is banned for extremely violent content, such as gore
    UNDERAGE_USERPlayer is banned for being underage
    CHEATINGPlayer is banned for cheating
    TOS_VIOLATIONPlayer is banned for violating the Terms of Service
  4. Type a comment to include any relevant information about the ban.

  5. Select the Notify user via email checkbox to send a ban notification to the player via email.

    important

    Players that log into your game using third-party credentials may only have a headless account in the Admin Portal. This means their account won't have an associated email address. Only players that have registered an account in your game (or platform), or have upgraded their headless account by registering an email address in your game, will be able to receive an email notification if they're banned. For more information, see How accounts work.

    Ban email example

    Image of an example ban notification email sent to the player

  6. Click Ban. The new ban appears in the Bans list.

    Image of the list of bans

Ban a player by device​

A Device Ban blocks a specific device using its unique ID. Any player who logs in on a banned device is blocked, regardless of which account they use. Unlike an Account Ban, which applies to a single player account, a Device Ban applies to the device itself.

note

The device ban feature is only available in game namespaces.

  1. On the Admin Portal sidebar, go to Foundations > Users.

  2. Search for the player you want to ban using their credentials. The search results appear.

    Image of the user search using credentials

  3. Click View in Action to open the account. The user account details appear.

    Image of the view option in the search results

  4. Click Bans, and then click Add Ban to ban the selected user. The Add Ban settings appear.

    Image of the option to add ban

Add the device ban details​

  1. In Ban type, choose Device Ban.

  2. In Device ID, choose the device you want to ban. A list of the devices used to log in by this player appears in this menu.

  3. In Ban Expiration, select one of the following:

    • Set by duration: Enter the number of minutes, hours, or days you want the player to be banned for. The ban expires after this duration.
    • Set by expiration date: Enter the date and time you want the ban to expire.
    • Never: Set a permanent ban.
  4. In Reason, choose a reason for the ban dropdown list.

  5. Type a Comment to include any relevant information about the ban.

  6. Click Ban. The ban appears in the Bans list.

Enable and disable ban​

You can reactivate an expired or disabled ban on a player, or lift an existing ban on a player. To do this:

  1. On the Admin Portal sidebar, go to Foundations > Users.

  2. Search the user account to view the account edit history. The search results appear.

  3. Browse the list to find the account you are looking for and click View in the Action column of the account listing to open it.

  4. Click Bans to ban the selected user. All the bans that have ever been applied to the player are displayed.

    Image of the option to add ban

  5. Click Disable under the Action column of the selected ban to disable the ban or click Enable under the Action column to enable the selected ban.

    Image of the disable ban option

  6. The Disable Ban confirmation message appears. Click Enable or Disable to ban or un-ban the player.

    Image of the confirmation to enable or disable a ban

  7. After you disable the ban, the player will be able to access the game or the feature they were banned from. If you enable a ban for a player, the player will now be banned from accessing the game or from the specific feature.

Ban or un-ban a player server-side​

Use the following server-side code to ban a player.

string playerUserID = "exampleuserid2434";
BanType banType = BanType.LOGIN;
BanReason banReason = BanReason.CHEATING;
var banEndDate = System.DateTime.UtcNow.AddDays(value: 365);
banEndDate = banEndDate.AddDays(365);
string comment = "This player was caught cheating";
bool notifyUserEmail = false;
string banId = string.Empty;

AccelByteSDK.GetServerRegistry().GetApi().GetUserAccount().BanUser(playerUserID, banType, banReason, banEndDate, comment, notifyUserEmail, result =>
{
if (!result.IsError)
{
Debug.Log("Success. The player is banned.");
}
else
{
Debug.Log("Failed to ban the player. Error : " + result.Error.ToString());
}
});

banId could be used to unban the player.

AccelByteSDK.GetServerRegistry().GetApi().GetUserAccount().ChangeUserBanStatus(
userId: playerUserID,
banId: banId,
enabled: false,
(result) =>
{
if (result.IsError)
{
Debug.Log("Success. Player is unbanned.");
}
else
{
Debug.Log("Failed to un-ban the player. Error : " + result.Error.ToString());
}
}
);

Ban Notifications​

Use the following code to implement ban notifications on the client side. Using this method, players can be told that they have been banned and the reason why.

AccelByteSDK.GetClientRegistry().GetApi().GetLobby().UserBannedNotification += result =>
{
Debug.Log("You have been banned. Reason: " + result.Value.reason);
};