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

# Update Channel

> Update an existing channel's configuration



## OpenAPI

````yaml https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/realtime.yaml put /api/realtime/channels/{id}
openapi: 3.0.3
info:
  title: Insforge Realtime API
  version: 1.0.0
  description: >-
    Realtime channel management, message history, permissions, and retention
    API. Live pub/sub uses Socket.IO.
servers: []
security: []
tags:
  - name: Channels
    description: Configure realtime channel patterns, webhooks, and availability.
  - name: Messages
    description: Inspect realtime message history and delivery stats.
  - name: Permissions
    description: Manage helper endpoints for realtime RLS examples.
  - name: Configuration
    description: Manage realtime retention settings.
paths:
  /api/realtime/channels/{id}:
    put:
      tags:
        - Channels
      summary: Update Channel
      description: Update an existing channel's configuration
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          example: 550e8400-e29b-41d4-a716-446655440000
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateChannelRequest'
            example:
              description: Updated order channel description
              enabled: false
      responses:
        '200':
          description: Channel updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Channel'
              example:
                id: 550e8400-e29b-41d4-a716-446655440000
                pattern: order:%
                description: Updated order channel description
                webhookUrls:
                  - https://example.com/webhook
                enabled: false
                createdAt: '2024-01-15T10:30:00Z'
                updatedAt: '2024-01-17T14:00:00Z'
        '400':
          description: Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: INVALID_INPUT
                message: 'webhookUrls.0: Invalid url'
                statusCode: 400
        '404':
          description: Channel not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: NOT_FOUND
                message: Channel not found
                statusCode: 404
      security:
        - bearerAuth: []
        - apiKey: []
components:
  schemas:
    UpdateChannelRequest:
      type: object
      properties:
        pattern:
          type: string
          minLength: 1
          description: Updated channel pattern
          example: order:%
        description:
          type: string
          description: Updated description
          example: Updated order channel
        webhookUrls:
          type: array
          items:
            type: string
            format: uri
          description: Updated webhook URLs
          example:
            - https://example.com/webhook
        enabled:
          type: boolean
          description: Updated enabled status
          example: false
    Channel:
      type: object
      required:
        - id
        - pattern
        - enabled
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the channel
          example: 550e8400-e29b-41d4-a716-446655440000
        pattern:
          type: string
          minLength: 1
          description: >-
            Channel pattern for subscription matching. Uses SQL LIKE wildcards,
            for example "order:%".
          example: order:%
        description:
          type: string
          nullable: true
          description: Human-readable description of the channel
          example: Order updates channel
        webhookUrls:
          type: array
          nullable: true
          items:
            type: string
            format: uri
          description: URLs to receive webhook notifications for messages on this channel
          example:
            - https://example.com/webhook
        enabled:
          type: boolean
          description: Whether the channel is currently active
          example: true
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the channel was created
          example: '2024-01-15T10:30:00Z'
        updatedAt:
          type: string
          format: date-time
          description: Timestamp when the channel was last updated
          example: '2024-01-15T10:30:00Z'
    ErrorResponse:
      type: object
      required:
        - error
        - message
        - statusCode
      properties:
        error:
          type: string
          description: Error code for programmatic handling
          example: INVALID_INPUT
        message:
          type: string
          description: Human-readable error message
          example: Invalid request
        statusCode:
          type: integer
          description: HTTP status code
          example: 400
        nextActions:
          type: string
          description: Suggested action to resolve the error
          example: Check your request parameters
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key

````