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

# Update widget

> Updates a widget by ID



## OpenAPI

````yaml /api-reference/oda-widget-service-1.0.0.yml patch /widgets/{id}
openapi: 3.0.1
info:
  title: ODA Widget Service
  description: ODA Widget Service
  contact:
    name: stCarolas
    email: stcarolas@gmail.com
  license:
    name: AGPL-3.0
    url: https://www.gnu.org/licenses/agpl-3.0.en.html
  version: 1.0.0
servers: []
security: []
paths:
  /widgets/{id}:
    patch:
      summary: Update widget
      description: Updates a widget by ID
      operationId: update
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWidgetRequest'
        required: true
      responses:
        '200':
          description: Widget updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WidgetDto'
        '401':
          description: Unauthorized
        '404':
          description: Widget not found
components:
  schemas:
    UpdateWidgetRequest:
      type: object
      properties:
        name:
          type: string
          nullable: true
        config:
          type: object
          additionalProperties:
            type: object
          nullable: true
        sortOrder:
          type: integer
          format: int32
          nullable: true
    WidgetDto:
      required:
        - config
        - deleted
        - enabled
        - id
        - name
        - ownerId
        - sortOrder
        - type
      type: object
      properties:
        id:
          type: string
        type:
          type: string
        sortOrder:
          type: integer
          format: int32
        name:
          type: string
        ownerId:
          type: string
        config:
          type: object
          additionalProperties:
            type: object
        enabled:
          type: boolean
        deleted:
          type: boolean

````