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

# Update a referenced row ID

> Updates the `rowId` on an existing `ReferencedRowInDocument` record identified by the `tableId` + `documentId` + `workspaceId` combination.

Requires edit access to the document.

Returns the MongoDB update result, or `null` if the record was not found.



## OpenAPI

````yaml put /referenced-rows-in-document/updateRowId
openapi: 3.1.0
info:
  title: HERO API
  version: current
  description: |-
    The HERO REST API.

    See https://developers.myhero.so for the rendered docs.
servers:
  - url: https://app.myhero.so
security: []
paths:
  /referenced-rows-in-document/updateRowId:
    put:
      tags:
        - References
      summary: Update a referenced row ID
      description: >-
        Updates the `rowId` on an existing `ReferencedRowInDocument` record
        identified by the `tableId` + `documentId` + `workspaceId` combination.


        Requires edit access to the document.


        Returns the MongoDB update result, or `null` if the record was not
        found.
      operationId: updateReferencedRowInDocument
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                documentId:
                  type: string
                  minLength: 1
                workspaceId:
                  type: string
                  minLength: 1
                tableId:
                  type: string
                  minLength: 1
                newRowId:
                  type:
                    - string
                    - 'null'
              required:
                - documentId
                - workspaceId
                - tableId
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type:
                      - object
                      - 'null'
                    properties:
                      acknowledged:
                        type: boolean
                        example: true
                      setOnInsert:
                        type: object
                        properties:
                          _id:
                            type: string
                          createdAt:
                            type: number
                        required:
                          - _id
                          - createdAt
                      set:
                        type: object
                        properties:
                          tableId:
                            type: string
                          documentId:
                            type: string
                          workspaceId:
                            type: string
                          rowId:
                            type: string
                          updatedAt:
                            type: number
                        required:
                          - tableId
                          - documentId
                          - workspaceId
                          - updatedAt
                    required:
                      - acknowledged
                      - setOnInsert
                      - set
                required:
                  - data
        '400':
          description: 400 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: |-
                      Error class name (e.g.

                      ValidationError, NotFound)
                  message:
                    type: string
                    description: Human-readable error message
                  details:
                    type: array
                    items: {}
                required:
                  - error
                  - message
        '403':
          description: 403 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: |-
                      Error class name (e.g.

                      ValidationError, NotFound)
                  message:
                    type: string
                    description: Human-readable error message
                  details:
                    type: array
                    items: {}
                required:
                  - error
                  - message
        '500':
          description: 500 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: |-
                      Error class name (e.g.

                      ValidationError, NotFound)
                  message:
                    type: string
                    description: Human-readable error message
                  details:
                    type: array
                    items: {}
                required:
                  - error
                  - message
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: HERO personal access token

````