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

> To create a Collection programmatically, provide as the body of the request the same JSON value that you would have provided in your manifest for a Collection when creating a custom app. Once created, the Collection can be retrieved by the name you provided as usual.

Setting `syncEnabled: true` causes the Collection's documents to be converted into rows in a Domo DataSet every 15 minutes. The `schema` you define controls which fields appear as DataSet columns — only the listed properties are synced. If you plan to use sync, note the following:

<Note>
**Date formatting:** Documents containing `DATE` or `DATETIME` data must use the format `YYYY-MM-DD` or `YYYY-MM-DDTHH:MM:SSZ` to sync correctly.
</Note>

<Warning>
**Only top-level fields can be synced.** Column names must be **top-level keys** in the document's `content` object; dot notation does not traverse nested objects during sync. To include a nested object, use the top-level key name (e.g., `wand`) — the synced value will be the JSON string representation of that object (e.g., `{"wood":"holly","core":"phoenix feather","length":11}`).
</Warning>

<Warning>
**Incorrect schema types prevent DataSet creation.** The accepted column types are `STRING` · `LONG` · `DECIMAL` · `DOUBLE` · `DATE` · `DATETIME`. If your AppDB DataSet doesn't appear after 15 minutes, verify your schema uses only these values — common mistakes include `NUMBER` or `INTEGER`.
</Warning>

<Warning>
**Collections won't sync if the collection owner lacks permissions on the target DataSet.** If that user is removed from Domo, syncing stops. The new owner must have both Collection ownership and Admin Permissions.
</Warning>




## OpenAPI

````yaml /openapi/framework/appdb.yaml post /domo/datastores/v1/collections
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/v1/collections:
    post:
      tags:
        - AppDB API
      summary: Create Collection
      description: >
        To create a Collection programmatically, provide as the body of the
        request the same JSON value that you would have provided in your
        manifest for a Collection when creating a custom app. Once created, the
        Collection can be retrieved by the name you provided as usual.


        Setting `syncEnabled: true` causes the Collection's documents to be
        converted into rows in a Domo DataSet every 15 minutes. The `schema` you
        define controls which fields appear as DataSet columns — only the listed
        properties are synced. If you plan to use sync, note the following:


        <Note>

        **Date formatting:** Documents containing `DATE` or `DATETIME` data must
        use the format `YYYY-MM-DD` or `YYYY-MM-DDTHH:MM:SSZ` to sync correctly.

        </Note>


        <Warning>

        **Only top-level fields can be synced.** Column names must be
        **top-level keys** in the document's `content` object; dot notation does
        not traverse nested objects during sync. To include a nested object, use
        the top-level key name (e.g., `wand`) — the synced value will be the
        JSON string representation of that object (e.g.,
        `{"wood":"holly","core":"phoenix feather","length":11}`).

        </Warning>


        <Warning>

        **Incorrect schema types prevent DataSet creation.** The accepted column
        types are `STRING` · `LONG` · `DECIMAL` · `DOUBLE` · `DATE` ·
        `DATETIME`. If your AppDB DataSet doesn't appear after 15 minutes,
        verify your schema uses only these values — common mistakes include
        `NUMBER` or `INTEGER`.

        </Warning>


        <Warning>

        **Collections won't sync if the collection owner lacks permissions on
        the target DataSet.** If that user is removed from Domo, syncing stops.
        The new owner must have both Collection ownership and Admin Permissions.

        </Warning>
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CollectionCreate'
            example:
              name: Students
              schema:
                columns:
                  - name: name
                    type: STRING
                  - name: house
                    type: STRING
                  - name: enrolledOn
                    type: DATE
                  - name: lastDetention
                    type: DATETIME
              syncEnabled: true
      responses:
        '200':
          description: Collection created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Collection'
              example:
                id: 757a1a2a-8d97-4c7e-875d-1bb5909df783
                datastoreId: a7363c9d-77ad-4ffa-8926-8295c8464f51
                defaultPermissions: null
                requiredAuthorities: null
                owner: 540824222
                name: Students
                datasourceId: null
                schema:
                  columns:
                    - type: STRING
                      name: name
                    - type: STRING
                      name: house
                    - type: DATE
                      name: enrolledOn
                    - type: DATETIME
                      name: lastDetention
                filters: null
                syncEnabled: true
                syncRequired: true
                cdcEnabled: false
                fullReplaceRequired: false
                lastSync: null
                createdOn: '2026-08-01T00:10:52.952Z'
                updatedOn: '2026-08-01T00:10:52.952Z'
                updatedBy: 540824222
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                missingName:
                  summary: Required field `name` was not provided
                  value:
                    message: >-
                      JSON parse error: Instantiation of [simple type, class
                      com.domo.magnum.model.collections.CollectionDefinition]
                      value failed for JSON property name due to missing
                      (therefore NULL) value for creator parameter name which is
                      a non-nullable type
                    status: 400
                    statusReason: Bad Request
                    toe: PTBS40L6BM-Y7P0M-4GA90
                syncEnabledWithoutSchema:
                  summary: '`syncEnabled: true` was passed without a `schema`'
                  value:
                    status: 400
                    statusReason: >-
                      status 400 reading
                      CollectionsResourceClient#createCollection(UUID,String,CollectionDefinition);
                      content:

                      {"message":"cannot enable sync when there is no schema
                      template provided","status":400,"statusReason":"Bad
                      Request","toe":"YI08S6SGHH-C1N9Z-XBPRW"}
                    toe: YI08S6SGHH-C1N9Z-XBPRW
      x-codeSamples:
        - lang: JavaScript
          label: domo.js
          source: |-
            domo.post('/domo/datastores/v1/collections', {
              name: 'Students',
              schema: {
                columns: [
                  { name: 'name', type: 'STRING' },
                  { name: 'house', type: 'STRING' },
                  { name: 'enrolledOn', type: 'DATE' },
                  { name: 'lastDetention', type: 'DATETIME' }
                ]
              },
              syncEnabled: true
            }).then(collection => console.log(collection));
        - lang: JavaScript
          label: domo.js v6
          source: |-
            // domo.js v6
            const collection = await domo.appdb.createCollection({
              name: 'Students',
              schema: {
                columns: [
                  { name: 'name', type: 'STRING' },
                  { name: 'house', type: 'STRING' },
                  { name: 'enrolledOn', type: 'DATE' },
                  { name: 'lastDetention', type: 'DATETIME' }
                ]
              },
              syncEnabled: true
            });
            console.log(collection);
        - 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:
  schemas:
    CollectionCreate:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          description: Name of the collection
        schema:
          $ref: '#/components/schemas/Schema'
        syncEnabled:
          type: boolean
          default: false
          description: >-
            Turning this property on causes the documents in your collection to
            be converted into rows in a DataSet every 15 minutes. Only the
            properties defined in the schema are synced. Requires `schema` to be
            provided — returns a 400 if `syncEnabled: true` is passed without a
            schema.
    Collection:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the collection.
        owner:
          type: integer
          format: int64
          description: User ID of the collection owner.
        datastoreId:
          type: string
          format: uuid
          description: ID of the datastore this collection belongs to.
        name:
          type: string
          description: Name of the collection.
        datasourceId:
          type: string
          format: uuid
          nullable: true
          description: ID of the linked Domo DataSet, or null if not yet linked.
        defaultPermissions:
          nullable: true
          description: >-
            Comma-separated default permission set for new app grants on this
            collection, or null if not set.
        requiredAuthorities:
          nullable: true
          description: >-
            Maps CollectionOperation names to required authority strings, or
            null if not set.
        filters:
          nullable: true
          description: >-
            Array of document-level filter predicates applied to read
            operations, or null if not set.
        schema:
          $ref: '#/components/schemas/Schema'
        syncEnabled:
          type: boolean
          description: Whether documents are periodically synced to the linked DataSet.
        syncRequired:
          type: boolean
          description: Whether a sync is pending.
        cdcEnabled:
          type: boolean
          description: Whether change data capture is enabled for this collection.
        fullReplaceRequired:
          type: boolean
        lastSync:
          type: string
          format: date-time
          nullable: true
        createdOn:
          type: string
          format: date-time
        updatedOn:
          type: string
          format: date-time
        updatedBy:
          type: integer
          format: int64
      example:
        id: a3aaeeed-5210-4048-9ff0-d88fa0de4eda
        datastoreId: 5565fecc-a852-4799-83bf-f9423c0f7687
        defaultPermissions: null
        requiredAuthorities: null
        owner: 870010733
        name: Students
        datasourceId: null
        schema:
          columns:
            - type: STRING
              name: name
            - type: STRING
              name: house
        filters: null
        syncEnabled: false
        syncRequired: false
        cdcEnabled: false
        fullReplaceRequired: false
        lastSync: null
        createdOn: '2026-06-25T01:26:34.744Z'
        updatedOn: '2026-06-25T01:26:34.744Z'
        updatedBy: 870010733
    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
    Schema:
      type: object
      properties:
        columns:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              type:
                type: string
                enum:
                  - STRING
                  - LONG
                  - DECIMAL
                  - DOUBLE
                  - DATE
                  - DATETIME
                description: >-
                  The type of value. Dates must be formatted as `YYYY-MM-DD`.
                  DateTimes must be formatted as `YYYY-MM-DDTHH:MM:SSZ`.

````