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

# Update Channel

> Update routing / session / config / enabled.



## OpenAPI

````yaml /versions/2.0.6dev/en/deploy/openapi.json patch /channels/{channel_id}
openapi: 3.1.0
info:
  title: AgentScope
  version: 2.0.6dev
servers: []
security: []
paths:
  /channels/{channel_id}:
    patch:
      tags:
        - channels
      summary: Update Channel
      description: Update routing / session / config / enabled.
      operationId: update_channel_channels__channel_id__patch
      parameters:
        - name: channel_id
          in: path
          required: true
          schema:
            type: string
            title: Channel Id
        - name: x-user-id
          in: header
          required: true
          schema:
            type: string
            description: >-
              Caller's user ID. Temporary header-based identity; will be
              replaced by JWT auth.
            title: X-User-Id
          description: >-
            Caller's user ID. Temporary header-based identity; will be replaced
            by JWT auth.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateChannelRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChannelResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    UpdateChannelRequest:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        platform_config:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Platform Config
        routing:
          anyOf:
            - $ref: '#/components/schemas/RoutingConfig'
            - type: 'null'
        session:
          anyOf:
            - $ref: '#/components/schemas/SessionSettings'
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Enabled
      type: object
      title: UpdateChannelRequest
      description: Request body for updating a channel (type/credentials immutable).
    ChannelResponse:
      properties:
        id:
          type: string
          title: Id
        channel_type:
          type: string
          title: Channel Type
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        user_id:
          type: string
          title: User Id
        platform_bot_id:
          type: string
          title: Platform Bot Id
        enabled:
          type: boolean
          title: Enabled
        platform_config:
          additionalProperties: true
          type: object
          title: Platform Config
        routing:
          $ref: '#/components/schemas/RoutingConfig'
        session:
          $ref: '#/components/schemas/SessionSettings'
        created_at:
          type: string
          title: Created At
        updated_at:
          type: string
          title: Updated At
      type: object
      required:
        - id
        - channel_type
        - name
        - user_id
        - platform_bot_id
        - enabled
        - platform_config
        - routing
        - session
        - created_at
        - updated_at
      title: ChannelResponse
      description: Channel details returned to the client (credentials omitted).
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    RoutingConfig:
      properties:
        bindings:
          items:
            $ref: '#/components/schemas/ChannelBinding'
          type: array
          title: Bindings
      type: object
      title: RoutingConfig
      description: |-
        Ordered routing rules for a channel.

        Validated so routing is always total and unambiguous: exactly one
        catch-all, placed last, with no duplicate ``(match_key,
        match_value)`` pairs.
    SessionSettings:
      properties:
        chat_model_config:
          additionalProperties: true
          type: object
          title: Chat Model Config
        fallback_chat_model_config:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Fallback Chat Model Config
        permission_mode:
          type: string
          title: Permission Mode
          default: default
      type: object
      required:
        - chat_model_config
      title: SessionSettings
      description: Settings applied when a channel creates an agent session.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ChannelBinding:
      properties:
        match_key:
          type: string
          title: Match Key
          default: chat_id
        match_value:
          type: string
          title: Match Value
          default: '*'
        agent_id:
          type: string
          title: Agent Id
        session_scope:
          $ref: '#/components/schemas/SessionScope'
          default: per_chat
      type: object
      required:
        - agent_id
      title: ChannelBinding
      description: |-
        One routing rule: match an inbound event, then decide which agent
        handles it and how its session is grouped.

        Rules are evaluated in list order; the first match wins. The final
        rule must be a catch-all (``match_value == "*"``) — it carries the
        channel's defaults.
    SessionScope:
      type: string
      enum:
        - per_chat
        - per_chat_user
      title: SessionScope
      description: |-
        How inbound messages are grouped into agent sessions.

        Scope is chat-centric: the session key is a projection of the
        ``(chat_id, user_id)`` pair.

````