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

> ## Agent Instructions
> Internal links on these pages omit the .md extension. Append .md to a docs page URL, or send an Accept: text/markdown header, to get that page as markdown.

# Update comment anchor

> <Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Moves a thread's pin and replaces its screenshot. Only the person who started the thread can do this.

`anchor` pins the thread to an element of the app's preview. The builder fills it in when you click an element, and `source_location` must match that element's `data-source-location` attribute in the preview for a pin to show. Leave `anchor` out to post a thread with no pin. It still shows in the builder's comments panel. The `anchor` you send replaces the old one in full.

Send `screenshot_file_uri` to attach a new screenshot, or leave it out or send `null` to remove the screenshot. To attach a screenshot, upload the image with [Upload app file](/api-reference/upload-app-file) and `visibility` set to `private`, then pass its `file_uri` as `screenshot_file_uri`. Only private files uploaded to this app are accepted. Anyone with the app open in the builder sees the change right away.

This is limited to 120 requests per minute per app, shared by every other comments endpoint. A signed-in session has its own limit, and every personal access token for the workspace shares one. Some workspaces have a different limit. Every request that counts against the limit gets `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset` (Unix time in seconds) headers, and a `429` also gets `Retry-After` in seconds. If the limiter itself is unavailable, requests go through without these headers.

<Note>Call this as an editor of the app, with a personal access token sent as a Bearer token or from a signed-in session. Viewers in the app's workspace, read-only tokens, and workspace API keys are refused.</Note>

<Warning>The response includes fields beyond the ones documented here. Don't rely on undocumented response fields, as they can change at any time.</Warning>



## OpenAPI

````yaml /developers/references/app-management/app-management-openapi.json patch /api/apps/{app_id}/comments/threads/{thread_id}/anchor
openapi: 3.1.0
info:
  title: Base44 App Management API
  version: 1.0.0
servers:
  - url: https://app.base44.com
security:
  - PersonalAccessTokenAuth: []
paths:
  /api/apps/{app_id}/comments/threads/{thread_id}/anchor:
    patch:
      summary: Update comment anchor
      description: >-
        <Info>This API is in beta. Endpoints, fields, and behavior may still
        change, so avoid depending on it in production.</Info>


        Moves a thread's pin and replaces its screenshot. Only the person who
        started the thread can do this.


        `anchor` pins the thread to an element of the app's preview. The builder
        fills it in when you click an element, and `source_location` must match
        that element's `data-source-location` attribute in the preview for a pin
        to show. Leave `anchor` out to post a thread with no pin. It still shows
        in the builder's comments panel. The `anchor` you send replaces the old
        one in full.


        Send `screenshot_file_uri` to attach a new screenshot, or leave it out
        or send `null` to remove the screenshot. To attach a screenshot, upload
        the image with [Upload app file](/api-reference/upload-app-file) and
        `visibility` set to `private`, then pass its `file_uri` as
        `screenshot_file_uri`. Only private files uploaded to this app are
        accepted. Anyone with the app open in the builder sees the change right
        away.


        This is limited to 120 requests per minute per app, shared by every
        other comments endpoint. A signed-in session has its own limit, and
        every personal access token for the workspace shares one. Some
        workspaces have a different limit. Every request that counts against the
        limit gets `X-RateLimit-Limit`, `X-RateLimit-Remaining` and
        `X-RateLimit-Reset` (Unix time in seconds) headers, and a `429` also
        gets `Retry-After` in seconds. If the limiter itself is unavailable,
        requests go through without these headers.


        <Note>Call this as an editor of the app, with a personal access token
        sent as a Bearer token or from a signed-in session. Viewers in the app's
        workspace, read-only tokens, and workspace API keys are refused.</Note>


        <Warning>The response includes fields beyond the ones documented here.
        Don't rely on undocumented response fields, as they can change at any
        time.</Warning>
      operationId: >-
        update_app_comment_anchor_api_apps__app_id__comments_threads__thread_id__anchor_patch
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            description: ID of the app.
            title: App Id
          description: ID of the app.
          example: 6820f3a4e7b91d003c45a1f2
        - name: thread_id
          in: path
          required: true
          schema:
            type: string
            description: >-
              ID of the comment thread, from `thread.id` in [List
              comments](/api-reference/list-comments).
            title: Thread Id
          description: >-
            ID of the comment thread, from `thread.id` in [List
            comments](/api-reference/list-comments).
          example: 68e2b7c1d4f0a9001c3e5a17
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAnchorPayload'
      responses:
        '200':
          description: The thread with its new pin.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommentThread'
        '400':
          description: '`screenshot_file_uri` isn''t a private file uploaded to this app.'
        '401':
          description: Missing or invalid credentials.
        '403':
          description: >-
            You don't have editor access to this app, you're a viewer in the
            app's workspace, the app is blocked, or your token is read-only or a
            workspace API key, or you didn't start this thread.
        '404':
          description: App or comment thread not found.
        '409':
          description: Your workspace requires an unlocked SSO session.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: >-
            Rate limit exceeded. Wait the number of seconds in `Retry-After`
            before retrying.
components:
  schemas:
    UpdateAnchorPayload:
      properties:
        anchor:
          $ref: '#/components/schemas/CommentAnchor'
          description: The thread's new pin. It replaces the old one in full.
        screenshot_file_uri:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Screenshot File Uri
          description: >-
            `file_uri` of a screenshot uploaded to this app with [Upload app
            file](/api-reference/upload-app-file) and `visibility` set to
            `private`. Starts with `mp/private/` followed by the app's ID.
          example: mp/private/6820f3a4e7b91d003c45a1f2/4b1e9c2a7_shot.png
      type: object
      required:
        - anchor
      title: UpdateAnchorPayload
      description: A thread's new pin and screenshot.
    CommentThread:
      properties:
        id:
          type: string
          title: Id
          description: ID of the thread.
          example: 68e2b7c1d4f0a9001c3e5a17
        page_path:
          type: string
          title: Page Path
          description: Path of the app page the thread is on.
          example: /pricing
        anchor:
          $ref: '#/components/schemas/CommentAnchor'
          description: Where the thread is pinned in the app's preview.
        screenshot_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Screenshot Url
          description: >-
            Signed link to the screenshot attached to the thread, valid for one
            hour. `null` when the thread has no screenshot or it can't be read.
          example: >-
            https://static.base44.com/images/private/6820f3a4e7b91d003c45a1f2/4b1e9c2a7_shot.png?token=eyJhbGciOi
        resolved_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Resolved At
          description: When the thread was resolved, in UTC, or `null` while it's open.
          example: '2026-10-05T09:14:22.512000Z'
        message_count:
          type: integer
          title: Message Count
          description: Number of replies, not counting the first comment.
          example: 2
        last_activity_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Activity At
          description: When the thread was created or last replied to, in UTC.
          example: '2026-10-05T09:14:22.512000Z'
        created_date:
          type: string
          format: date-time
          title: Created Date
          description: When the thread was created, in UTC.
          example: '2026-10-05T09:14:22.512000Z'
        agent_working_since:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Agent Working Since
          description: >-
            When the builder agent started working on the thread, in UTC, or
            `null` when it isn't working on it. A value older than an hour is
            left over from a turn that stopped.
          example: '2026-10-05T09:14:22.512000Z'
        unread:
          type: boolean
          title: Unread
          description: >-
            Whether the thread has a comment from someone else posted after you
            last read it. Always `false` in the responses of Create comment and
            Update comment anchor.
          example: true
      type: object
      required:
        - id
        - page_path
        - anchor
        - screenshot_url
        - resolved_at
        - message_count
        - last_activity_at
        - created_date
        - agent_working_since
        - unread
      title: CommentThread
      description: A comment thread's state.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CommentAnchor:
      properties:
        source_location:
          anyOf:
            - type: string
              maxLength: 512
            - type: 'null'
          title: Source Location
          description: >-
            Position of the element's tag in the app's code, as
            `file:line:column`, exactly as the element's `data-source-location`
            attribute in the preview. The pin shows only on an element with this
            value. `null` for a thread with no pin.
          example: pages/Pricing.jsx:42:8
        element_tag:
          anyOf:
            - type: string
              maxLength: 64
            - type: 'null'
          title: Element Tag
          description: HTML tag of the element, such as `button`.
          example: button
        instance_index:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Instance Index
          description: >-
            Which of the elements sharing `source_location` the pin is on,
            counting from `0` in page order, for an element repeated in a list.
            `null` means the first.
          example: 0
        point:
          anyOf:
            - $ref: '#/components/schemas/CommentAnchorPoint'
            - type: 'null'
          description: >-
            Where on the element the pin sits. `null` puts it at the middle of
            the top edge.
        crop:
          anyOf:
            - $ref: '#/components/schemas/CommentAnchorCrop'
            - type: 'null'
          description: >-
            Area of the page the screenshot shows, used to redraw the crop box
            in the builder.
        region:
          anyOf:
            - $ref: '#/components/schemas/CommentAnchorRegion'
            - type: 'null'
          description: Area of the visible preview the screenshot shows when it was taken.
        viewport_size:
          anyOf:
            - $ref: '#/components/schemas/CommentAnchorViewportSize'
            - type: 'null'
          description: Size of the preview when the screenshot was taken.
      type: object
      title: CommentAnchor
      description: >-
        Where a comment thread is pinned in the app's preview. When the
        builder's AI edits the anchored

        file, Base44 moves an open thread's `source_location` to the element's
        new line.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    CommentAnchorPoint:
      properties:
        x:
          type: number
          maximum: 1
          minimum: 0
          title: X
          description: Horizontal position, as a fraction of the element's width.
          example: 0.5
        'y':
          type: number
          maximum: 1
          minimum: 0
          title: 'Y'
          description: Vertical position, as a fraction of the element's height.
          example: 0.5
      type: object
      required:
        - x
        - 'y'
      title: CommentAnchorPoint
      description: Fractions of the anchored element's rect, not of the document.
    CommentAnchorCrop:
      properties:
        x:
          type: number
          title: X
          description: Left edge, in page pixels.
          example: 512
        'y':
          type: number
          title: 'Y'
          description: Top edge, in page pixels, scroll included.
          example: 1340
        width:
          type: number
          exclusiveMinimum: 0
          title: Width
          description: Width, in pixels.
          example: 240
        height:
          type: number
          exclusiveMinimum: 0
          title: Height
          description: Height, in pixels.
          example: 96
      type: object
      required:
        - x
        - 'y'
        - width
        - height
      title: CommentAnchorCrop
      description: >-
        The screenshot's area in page pixels: the visible area plus the page's
        scroll when it was taken.
    CommentAnchorRegion:
      properties:
        x:
          type: number
          maximum: 1
          minimum: 0
          title: X
          description: Left edge, as a fraction of the preview's width.
          example: 0.42
        'y':
          type: number
          maximum: 1
          minimum: 0
          title: 'Y'
          description: Top edge, as a fraction of the preview's height.
          example: 0.18
        width:
          type: number
          maximum: 1
          minimum: 0
          title: Width
          description: Width, as a fraction of the preview's width.
          example: 0.2
        height:
          type: number
          maximum: 1
          minimum: 0
          title: Height
          description: Height, as a fraction of the preview's height.
          example: 0.08
      type: object
      required:
        - x
        - 'y'
        - width
        - height
      title: CommentAnchorRegion
      description: >-
        The screenshot's area as fractions of the visible preview when it was
        taken, so it depends on the scroll.
    CommentAnchorViewportSize:
      properties:
        width:
          type: integer
          minimum: 1
          title: Width
          description: Width of the preview, in pixels.
          example: 1280
        height:
          type: integer
          minimum: 1
          title: Height
          description: Height of the preview, in pixels.
          example: 800
      type: object
      required:
        - width
        - height
      title: CommentAnchorViewportSize
      description: Size of the preview when the screenshot was taken.
  securitySchemes:
    PersonalAccessTokenAuth:
      type: http
      scheme: bearer
      description: 'Personal access token, sent as `Authorization: Bearer <token>`.'

````

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