> ## 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.

# Import Documents

> Bulk-import complete document objects into a collection — the counterpart to Download Documents. Each item must be a full document (including its `id`); documents are **upserted by `id`**, so the original `id`, `createdOn`, and `owner` are preserved. This is the format produced by Download Documents, which makes the two endpoints a copy/restore pair. To add brand-new documents from raw content instead, use Create Document. Existing documents not present in the payload are left untouched.



## OpenAPI

````yaml /openapi/product/appdb.yaml put /api/datastores/v2/collections/{collectionId}/documents/import
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/import:
    put:
      tags:
        - App DB API (Product)
      summary: Import Documents
      description: >-
        Bulk-import complete document objects into a collection — the
        counterpart to Download Documents. Each item must be a full document
        (including its `id`); documents are **upserted by `id`**, so the
        original `id`, `createdOn`, and `owner` are preserved. This is the
        format produced by Download Documents, which makes the two endpoints a
        copy/restore pair. To add brand-new documents from raw content instead,
        use Create Document. Existing documents not present in the payload are
        left untouched.
      parameters:
        - name: collectionId
          in: path
          required: true
          schema:
            type: string
          description: The ID of the collection.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $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-23T23:36:13.177Z'
                updatedBy: '870010733'
                content:
                  username: bill
                  email: bill@example.com
      responses:
        '200':
          description: Import completed. Returns counts of the operations performed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  Updated:
                    type: integer
                    description: Number of existing documents that were updated.
                  Created:
                    type: integer
                    description: Number of documents created.
                  Upserted:
                    type: integer
                    description: >-
                      Number of documents inserted via upsert (matched no
                      existing document).
              example:
                Updated: 0
                Created: 0
                Upserted: 1
components:
  schemas:
    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
  securitySchemes:
    developerToken:
      type: apiKey
      in: header
      name: X-DOMO-Developer-Token
      description: Domo Developer Token for authentication.

````