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

# Replace Document

> Replaces an existing document in a collection — the entire `content` object is overwritten with whatever you send. To update individual fields without replacing the whole document, use the Partially Update Documents endpoint instead.



## OpenAPI

````yaml /openapi/product/appdb.yaml put /api/datastores/v2/collections/{collectionId}/documents/{documentId}
openapi: 3.0.0
info:
  title: App DB API
  version: v1
  description: |
    The App DB API allows developers to interact with AppDB, a NoSQL database 
    for storing arbitrary JSON documents. This API supports CRUD operations, 
    querying, and aggregation, enabling developers to manage data efficiently 
    within their Domo applications.
servers:
  - url: https://{instance}.domo.com
    description: Domo Instance
    variables:
      instance:
        default: api
        description: Your specific Domo instance name (e.g., mycompany)
security:
  - developerToken: []
tags:
  - name: Documents
    description: Manage individual documents in an AppDB collection.
  - name: Collections
    description: Manage AppDB collections (schema, permissions).
  - name: App DB API (Product)
    description: Manage documents and collections in AppDB.
paths:
  /api/datastores/v2/collections/{collectionId}/documents/{documentId}:
    put:
      tags:
        - App DB API (Product)
      summary: Replace Document
      description: >-
        Replaces an existing document in a collection — the entire `content`
        object is overwritten with whatever you send. To update individual
        fields without replacing the whole document, use the Partially Update
        Documents endpoint instead.
      parameters:
        - name: collectionId
          in: path
          required: true
          schema:
            type: string
          description: The ID of the collection.
        - name: documentId
          in: path
          required: true
          schema:
            type: string
          description: The ID of the document.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentContent'
            examples:
              campaign:
                summary: Campaign document
                value:
                  content:
                    campaignName: Q2 Campaign
                    region: West
                    status: Inactive
              allTypes:
                summary: One of each supported field type
                value:
                  content:
                    name: Example Record
                    count: 42
                    unitPriceDecimal: 9.99
                    conversionRateDouble: 0.3333333333333333
                    startDate: '2026-06-24'
                    createdAt: '2026-06-24T17:42:06.949Z'
                    isActive: true
                    deletedAt: null
                    address:
                      street: 123 Main St
                      city: Austin
                    tags:
                      - featured
                      - new
                      - sale
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Document'
              example:
                id: a8428d64-a01d-49b2-9144-ddeec001acf8
                datastoreId: 39b88a97-8247-4c0d-ba1d-8ed78d1a6680
                collectionId: 232e6d6c-46e9-49b6-a137-8933f0f05999
                syncRequired: true
                owner: '870010733'
                createdBy: '870010733'
                createdOn: '2026-06-23T20:58:06.567Z'
                updatedOn: '2026-06-24T14:22:11.403Z'
                updatedBy: '870010733'
                content:
                  campaignName: Q2 Campaign
                  region: West
                  status: Inactive
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                message: >-
                  Could not find document with id
                  'b1e2f3a4-c5d6-7890-abcd-ef1234567890' to update
                status: 404
                statusReason: Not Found
                toe: HKUMCHOWVY-GRVTS-RU3ZG
components:
  schemas:
    DocumentContent:
      type: object
      properties:
        content:
          type: object
          additionalProperties: true
          description: >-
            Arbitrary JSON content of the document. If omitted, the document is
            created with an empty content object.
    Document:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the document.
        datastoreId:
          type: string
          description: ID of the datastore the document belongs to.
        collectionId:
          type: string
          description: ID of the collection the document belongs to.
        syncRequired:
          type: boolean
          description: Whether the document is pending a sync to the underlying dataset.
        owner:
          type: string
          description: >-
            User ID of the document owner. v2 endpoints return this as a string;
            v1 endpoints (List, Get, Query, Update) return it as a numeric
            integer. This differs from Collection and Datastore owner fields,
            which are always integers.
        createdBy:
          type: string
          description: >-
            User ID of the user who created the document. v2 endpoints always
            return this field. v1 endpoints return it only from Create Document;
            all other v1 endpoints (List, Get, Query, Update) omit it.
        createdOn:
          type: string
          format: date-time
          description: ISO 8601 timestamp when the document was created.
        updatedOn:
          type: string
          format: date-time
          description: ISO 8601 timestamp when the document was last updated.
        updatedBy:
          type: string
          description: >-
            User ID of the user who last updated the document. v2 endpoints
            return this as a string; v1 endpoints return it as a numeric
            integer.
        content:
          type: object
          additionalProperties: true
          description: Arbitrary JSON content of the document.
      example:
        id: a8428d64-a01d-49b2-9144-ddeec001acf8
        datastoreId: 39b88a97-8247-4c0d-ba1d-8ed78d1a6680
        collectionId: 232e6d6c-46e9-49b6-a137-8933f0f05999
        syncRequired: true
        owner: '870010733'
        createdBy: '870010733'
        createdOn: '2026-06-23T20:58:06.567Z'
        updatedOn: '2026-06-23T23:36:13.177Z'
        updatedBy: '870010733'
        content:
          campaignName: Q2 Campaign
          region: West
          status: Active
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: A human-readable error message.
        status:
          type: integer
          description: HTTP status code.
        statusReason:
          type: string
          description: HTTP status reason phrase.
        toe:
          type: string
          description: Trace identifier for support; stands for Thread of Execution.
  securitySchemes:
    developerToken:
      type: apiKey
      in: header
      name: X-DOMO-Developer-Token
      description: Domo Developer Token for authentication.

````