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

# Create a collection

> Creates a new knowledge collection for the authenticated team.



## OpenAPI

````yaml https://staging.aigmented.io/api/v1/openapi.json post /api/v1/collections/add
openapi: 3.1.0
info:
  title: Aigmented API
  version: 1.0.0
  description: >-
    REST API for Aigmented — manage knowledge collections, upload files, search
    knowledge cards, and ask questions with LLM-powered answers.
  contact:
    name: Aigmented Support
    url: https://aigmented.com
servers:
  - url: https://aigmented.io
    description: Production
security:
  - BearerAuth: []
tags:
  - name: Collections
    description: Create and manage knowledge collections
  - name: Files
    description: Upload and manage source documents
  - name: Search
    description: Semantic search over knowledge cards in a collection
  - name: Ask
    description: LLM-powered question answering over a collection
paths:
  /api/v1/collections/add:
    post:
      tags:
        - Collections
      summary: Create a collection
      description: Creates a new knowledge collection for the authenticated team.
      operationId: createCollection
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              properties:
                name:
                  type: string
                  description: Display name for the collection
                  example: Q4 2024 Contracts
      responses:
        '200':
          description: Collection created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Collection added
                  data:
                    $ref: '#/components/schemas/Collection'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Collection:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        status:
          type: string
        publish_disabled:
          type: boolean
          description: Whether publishing is disabled for this collection
        uploaded_at:
          type: string
          format: date-time
        user:
          type: object
          properties:
            id:
              type: string
            email:
              type: string
            name:
              type: string
        _count:
          type: object
          properties:
            knowledgeCards:
              type: integer
            fileInstances:
              type: integer
            chats:
              type: integer
    Error:
      type: object
      properties:
        error:
          type: string
          description: Human-readable error message
      required:
        - error
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key (sk-...)
      description: >-
        Pass your API key as a Bearer token. Example: `Authorization: Bearer
        sk-xxxxxxxxxxxx`

````