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

# Update Widget

> Changes a widget; send only what changes. A refused call changes nothing. A social widget: its name, layout, settings (the names in get_widget's settings; list_widget_types gives each setting's allowed values), its accounts (all of them, in order: the first, of the widget's service, gives the header) and its campaign (for the "hashtag-campaign" filter; a widget that leaves its campaign needs its accounts in the same call). A review widget: its name, layout, settings and review sources. The site shows a change within a few minutes. embed_code_changed true (for example a new size of a widget with a fixed width and height) on a widget that is already on a site: give the user the new embed_code and the steps of get_embed_code to replace the code on the site.



## OpenAPI

````yaml https://snapwidget.com/api/v1/openapi.json patch /widgets/{id}
openapi: 3.1.0
info:
  title: SnapWidget API
  version: '1'
  description: >-
    Make and change social feed and review widgets, connect social accounts and
    get the embed code. The MCP server at https://snapwidget.com/mcp has the
    same actions for AI agents.
  termsOfService: https://snapwidget.com/terms
  contact:
    name: SnapWidget
    email: support@snapwidget.com
    url: https://snapwidget.com/docs/api-reference/introduction
servers:
  - url: https://snapwidget.com/api/v1
security:
  - token: []
tags:
  - name: Sign-up
  - name: Account
  - name: Social accounts
  - name: Widgets
  - name: Reviews
  - name: Campaigns
paths:
  /widgets/{id}:
    patch:
      tags:
        - Widgets
      summary: Update Widget
      description: >-
        Changes a widget; send only what changes. A refused call changes
        nothing. A social widget: its name, layout, settings (the names in
        get_widget's settings; list_widget_types gives each setting's allowed
        values), its accounts (all of them, in order: the first, of the widget's
        service, gives the header) and its campaign (for the "hashtag-campaign"
        filter; a widget that leaves its campaign needs its accounts in the same
        call). A review widget: its name, layout, settings and review sources.
        The site shows a change within a few minutes. embed_code_changed true
        (for example a new size of a widget with a fixed width and height) on a
        widget that is already on a site: give the user the new embed_code and
        the steps of get_embed_code to replace the code on the site.
      operationId: update_widget
      parameters:
        - name: id
          in: path
          required: true
          description: The widget's id (the id in list_widgets).
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                layout:
                  description: >-
                    A new layout of the same kind. A social widget keeps its
                    service and plan.
                  type: string
                settings:
                  description: >-
                    The settings to change, as {name: value}, for example
                    {"layoutx": 4, "layouty": 2, "name": "Home page feed"}.
                  type: object
                accounts:
                  description: >-
                    Social widget: all its account ids from list_accounts, in
                    order, in place of the current ones.
                  items:
                    type: integer
                  type: array
                campaign_id:
                  description: >-
                    Social widget: one of the user's campaigns (list_campaigns),
                    with the setting filter_type "hashtag-campaign".
                  type: integer
                name:
                  description: The widget's name in the Widgets list.
                  type: string
                source_ids:
                  description: >-
                    Review widget: all its review source ids from
                    list_review_sources, in place of the current ones.
                  items:
                    type: string
                  type: array
      responses:
        '200':
          description: The answer, as JSON.
          content:
            application/json:
              schema:
                type: object
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/Invalid'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  responses:
    Unauthorized:
      description: No token, or the token is wrong, expired or revoked.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: >-
        The token or the plan has no API access, or the plan does not allow the
        change.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: No item with this id in the account.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Invalid:
      description: An input is not valid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TooManyRequests:
      description: Too many calls. The Retry-After header gives the seconds to wait.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      properties:
        message:
          type: string
          description: What went wrong.
        errors:
          type: object
          description: The messages per input, when an input is not valid.
          additionalProperties:
            type: array
            items:
              type: string
        upgrade_url:
          type: string
          description: The upgrade page, when the plan does not allow it.
      required:
        - message
  securitySchemes:
    token:
      type: http
      scheme: bearer
      description: 'A token from the API page: https://snapwidget.com/settings/api'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.