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

# Create Documents in Bulk

> Create multiple documents in a given collection in a single HTTP request. Each document is limited to 2 MB.



## OpenAPI

````yaml /openapi/framework/appdb.yaml post /domo/datastores/v2/collections/{collectionName}/documents/bulk
openapi: 3.0.0
info:
  title: Domo AppDB API
  version: v1
  description: >
    AppDB API for storing arbitrary JSON documents similar to a NoSQL database.
    This enables storing state within your DomoApp

    with optional syncing to Domo DataSets.


    Three layers provide data storage:

    - **Datastores**: Analogous to a database. A CustomApp has a single
    datastore created automatically.

    - **Collections**: Analogous to a collection in NoSQL or table in relational
    databases.

    - **Documents**: Analogous to documents in NoSQL or table rows in relational
    databases.
servers:
  - url: https://{instance}.domo.com
    description: Domo Instance
    variables:
      instance:
        default: example
        description: Your Domo instance name
security: []
paths:
  /domo/datastores/v2/collections/{collectionName}/documents/bulk:
    post:
      tags:
        - AppDB API
      summary: Create Documents in Bulk
      description: >-
        Create multiple documents in a given collection in a single HTTP
        request. Each document is limited to 2 MB.
      parameters:
        - $ref: '#/components/parameters/CollectionName'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/DocumentCreate'
            example:
              - content:
                  name: Draco Malfoy
                  house: Slytherin
                  wand:
                    wood: hawthorn
                    core: unicorn hair
                    length: 10
                  courses:
                    - Potions
                    - Transfiguration
                    - Defense Against the Dark Arts
                  prefect: true
              - content:
                  name: Luna Lovegood
                  house: Ravenclaw
                  courses:
                    - Charms
                    - Defense Against the Dark Arts
                    - Care of Magical Creatures
      responses:
        '200':
          description: Bulk creation result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkCreateResponse'
              example:
                Created: 2
        '403':
          description: >-
            Forbidden. The user does not have the CREATE_CONTENT permission on
            this collection.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                status: 403
                toe: OK7MYQR2W9-49AOV-77KCS
        '404':
          description: >-
            Collection not found. Verify the collection name is correct (it is
            case-sensitive) and that the collection has been created or
            correctly wired in this app's datastore.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                status: 404
                statusReason: 'DA0088: Invalid collection name: students'
                toe: 182LQAYFQ7-WJY65-XJLCA
      x-codeSamples:
        - lang: JavaScript
          label: domo.js
          source: >-
            const collectionName = 'Students';


            domo.post(`/domo/datastores/v2/collections/${collectionName}/documents/bulk`,
            [
              {
                content: {
                  name: 'Draco Malfoy',
                  house: 'Slytherin',
                  wand: { wood: 'hawthorn', core: 'unicorn hair', length: 10 },
                  courses: ['Potions', 'Transfiguration', 'Defense Against the Dark Arts'],
                  prefect: true
                }
              },
              {
                content: {
                  name: 'Luna Lovegood',
                  house: 'Ravenclaw',
                  courses: ['Charms', 'Defense Against the Dark Arts', 'Care of Magical Creatures']
                }
              }
            ]).then(result => console.log(result));
        - lang: JavaScript
          label: domo.js v6
          source: |-
            // domo.js v6
            const collectionName = 'Students';

            // bulkCreate auto-wraps content — pass content fields directly.
            const result = await domo.appdb.bulkCreate(collectionName, [
              {
                name: 'Draco Malfoy',
                house: 'Slytherin',
                wand: { wood: 'hawthorn', core: 'unicorn hair', length: 10 },
                courses: ['Potions', 'Transfiguration', 'Defense Against the Dark Arts'],
                prefect: true
              },
              {
                name: 'Luna Lovegood',
                house: 'Ravenclaw',
                courses: ['Charms', 'Defense Against the Dark Arts', 'Care of Magical Creatures']
              }
            ]);
            console.log(result);
        - lang: cURL
          label: cURL
          source: |-
            # This API is only available inside a Domo app.
            # Use the JavaScript (domo.js) tab for the correct usage.
        - lang: Python
          label: Python
          source: |-
            # This API is only available inside a Domo app.
            # Use the JavaScript (domo.js) tab for the correct usage.
        - lang: PHP
          label: PHP
          source: |-
            // This API is only available inside a Domo app.
            // Use the JavaScript (domo.js) tab for the correct usage.
        - lang: Go
          label: Go
          source: |-
            // This API is only available inside a Domo app.
            // Use the JavaScript (domo.js) tab for the correct usage.
        - lang: Java
          label: Java
          source: |-
            // This API is only available inside a Domo app.
            // Use the JavaScript (domo.js) tab for the correct usage.
        - lang: Ruby
          label: Ruby
          source: |-
            # This API is only available inside a Domo app.
            # Use the JavaScript (domo.js) tab for the correct usage.
components:
  parameters:
    CollectionName:
      name: collectionName
      in: path
      required: true
      description: The name given to the collection in the manifest. Case-sensitive.
      schema:
        type: string
  schemas:
    DocumentCreate:
      type: object
      required:
        - content
      properties:
        content:
          type: object
          additionalProperties: true
          description: The document content matching collection schema
    BulkCreateResponse:
      type: object
      properties:
        Created:
          type: integer
      example:
        Created: 2
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: >-
            A plain-English explanation of the error. Present on some errors but
            not all.
        status:
          type: integer
          description: The HTTP error code
        statusReason:
          type: string
          description: >-
            A human-readable error message, sometimes including nested error
            detail
        toe:
          type: string
          description: >-
            Thread of Execution; a unique identifier that Support can use to
            find more info about your problem
      example:
        status: 404
        statusReason: 'DA0088: Invalid collection name: Students'
        toe: FTYRJMBLKD-5HB2Z-H6W8A

````