> ## Documentation Index
> Fetch the complete documentation index at: https://microstrate-1133-notifications-prefs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a new collection

> Creates a new collection for organizing nodes or workflows



## OpenAPI

````yaml /api-reference/endpoint/hub-flows/openapi.json post /hub/collections
openapi: 3.0.0
info:
  title: quiva.ai Gateway
  description: API for managing collections, nodes, and workflows in quiva.ai Hub
  version: 0.1.0
  contact:
    name: quiva.ai Support
servers:
  - url: https://api.quiva.ai
    description: Production API server
security:
  - bearerAuth: []
  - apiKeyAuth: []
tags:
  - name: Collections
    description: Operations related to collections
  - name: Nodes
    description: Operations related to nodes
  - name: Workflows
    description: Operations related to workflows
  - name: Oauth
    description: Oauth configurations and connections
paths:
  /hub/collections:
    post:
      tags:
        - Collections
      summary: Create a new collection
      description: Creates a new collection for organizing nodes or workflows
      operationId: createCollection
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCollectionRequest'
            examples:
              NodeCollection:
                summary: Create a node collection
                value:
                  name: Payment Processing Nodes
                  collection_type: node
                  description: Collection of reusable payment processing node templates
              WorkflowCollection:
                summary: Create a workflow collection
                value:
                  name: Order Management Flows
                  collection_type: workflow
                  description: Workflows for handling order lifecycle
              MinimalCollection:
                summary: Create collection with minimal fields
                value:
                  name: Utilities
                  collection_type: node
      responses:
        '201':
          description: Collection created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCollectionResponse'
              examples:
                NodeCollectionCreated:
                  summary: Node collection created
                  value:
                    subject: ms.hub.config.collection.node.805092869
                    name: Payment Processing Nodes
                    collection_type: node
                    topic: '805092869'
                    description: Collection of reusable payment processing node templates
                    modified: 1748533179
                WorkflowCollectionCreated:
                  summary: Workflow collection created
                  value:
                    subject: ms.hub.config.collection.workflow.1508781670
                    name: Order Management Flows
                    collection_type: workflow
                    topic: '1508781670'
                    description: Workflows for handling order lifecycle
                    modified: 1748533200
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                NameRequired:
                  value:
                    error: a name is required
                InvalidType:
                  value:
                    error: 'invalid collection type. Valid types are: node, workflow'
        '409':
          description: Collection already exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: collection exists:ms.hub.config.collection.node.1234567890
components:
  schemas:
    CreateCollectionRequest:
      type: object
      required:
        - name
        - collection_type
      properties:
        name:
          type: string
          description: Name of the collection
        collection_type:
          type: string
          enum:
            - node
            - workflow
          description: Type of the collection (node or workflow)
        description:
          type: string
          description: Optional description of the collection
    CreateCollectionResponse:
      type: object
      properties:
        subject:
          type: string
          description: Subject identifier for the collection
        name:
          type: string
          description: Name of the collection
        collection_type:
          type: string
          description: Type of the collection (node or workflow)
        topic:
          type: string
          description: Hash of the collection name
        description:
          type: string
          description: Description of the collection
        modified:
          $ref: '#/components/schemas/Modified'
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message
    Modified:
      type: integer
      description: Timestamp of last modification
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT Authorization header using the Bearer scheme
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key

````