> ## 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.

# Set routing status

> Changes the status of an agent or a bot agent.

**Required scopes:** For agents: <Tooltip tip="To set my routing status.">`agents--my:rw`</Tooltip> or <Tooltip tip="To set the routing status of any agent within a license.">`agents--all:rw`</Tooltip>. For bot agents: <Tooltip tip="To set the routing status of bots that belong to the client_id related to the token (within a license).">`agents-bot--my:rw`</Tooltip> or <Tooltip tip="To set the routing status of any bots within a license. For bots of type ai_agent, you can only change the routing status with tokens issued for the client_id that owns them.">`agents-bot--all:rw`</Tooltip>


## OpenAPI

````yaml /api/agent-chat/v3.7/openapi.json post /action/set_routing_status
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.7'
servers:
  - url: https://api.livechatinc.com/v3.7/agent
    description: Production server
security: []
paths:
  /action/set_routing_status:
    post:
      tags:
        - Status
      summary: Set routing status
      description: Changes the status of an agent or a bot agent.
      operationId: set-routing-status
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetRoutingStatusRequest'
            example:
              status: accepting_chats
              agent_id: smith@example.com
      responses:
        '200':
          description: Routing status set.
      security:
        - PersonalAccessToken: []
        - OAuth2BearerToken:
            - agents--my:rw
components:
  schemas:
    SetRoutingStatusRequest:
      type: object
      required:
        - status
      properties:
        status:
          type: string
          description: >-
            The routing status to set. For agents: `accepting_chats` or
            `not_accepting_chats`. For bot agents: `accepting_chats`,
            `not_accepting_chats`, or `offline`.
        agent_id:
          type: string
          description: >-
            The agent ID. If not specified, the requester's status will be
            updated.
  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

````