> ## Documentation Index
> Fetch the complete documentation index at: https://www.text.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Ban customer

> Bans the customer for a specific period of time. It immediately disconnects all active sessions of this customer and does not accept new ones during the ban lifespan.

**Required scopes:** `customers.ban:rw`


## OpenAPI

````yaml /api/agent-chat/v3.6/openapi.json post /action/ban_customer
openapi: 3.0.0
info:
  title: Agent Chat API
  description: >-
    The Agent Chat API allows you to manage chats, threads, events, and agent
    state.
  version: '3.6'
servers:
  - url: https://api.livechatinc.com/v3.6/agent
    description: Production server
security: []
paths:
  /action/ban_customer:
    post:
      tags:
        - Customers
      summary: Ban customer
      description: >-
        Bans the customer for a specific period of time. It immediately
        disconnects all active sessions of this customer and does not accept new
        ones during the ban lifespan.
      operationId: ban-customer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BanCustomerRequest'
            example:
              id: b7eff798-f8df-4364-8059-649c35c9ed0c
              ban:
                days: 3
      responses:
        '200':
          description: Customer banned.
      security:
        - PersonalAccessToken: []
        - OAuth2BearerToken:
            - customers.ban:rw
components:
  schemas:
    BanCustomerRequest:
      type: object
      required:
        - id
        - ban
      properties:
        id:
          type: string
          description: The customer ID.
        ban:
          type: object
          required:
            - days
          description: The ban details.
          properties:
            days:
              type: number
              description: The number of days for the ban.
  securitySchemes:
    PersonalAccessToken:
      description: >-
        Use your `account ID` as the username and your personal access token
        (PAT) as the password, or pass a Base64-encoded value directly in the
        Authorization header. For more information, see the <a
        href="/authentication/personal-access-tokens">personal access tokens
        guide</a>.
      type: http
      scheme: basic
    OAuth2BearerToken:
      description: >-
        This API uses OAuth2 with the implicit grant flow. <a
        href="/authentication/oauth-authorization#implicit-grant">Learn about
        the implicit grant flow.</a>
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://accounts.livechat.com
          scopes:
            chats--all:ro: Read all chats
            chats--all:rw: Read and write all chats
            chats--access:ro: Read chats from groups the agent is a member of
            chats--access:rw: Read and write chats from groups the agent is a member of
        authorizationCode:
          authorizationUrl: https://accounts.livechat.com
          tokenUrl: https://accounts.livechat.com/token
          scopes:
            chats--all:ro: Read all chats
            chats--all:rw: Read and write all chats
            chats--access:ro: Read chats from groups the agent is a member of
            chats--access:rw: Read and write chats from groups the agent is a member of

````