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

# Create Collection

> Create a collection with optional caller-provided ID and timestamps.
If `id` already exists, this request returns a conflict.
Use collection membership endpoints to add, remove, or move notes between collections.



## OpenAPI

````yaml POST /v2/collections
openapi: 3.1.0
info:
  title: Mem API
  description: An API that allows you to interact with the Mem platform.
  version: 1.0.0
servers:
  - url: https://api.mem.ai
security:
  - bearerAuth: []
paths:
  /v2/collections:
    post:
      tags:
        - external
        - external-v2
      summary: Create Collection
      description: >-
        Create a collection with optional caller-provided ID and timestamps.

        If `id` already exists, this request returns a conflict.

        Use collection membership endpoints to add, remove, or move notes
        between collections.
      operationId: app_src_api_routes_external_v2_collections_views_create_collection
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCollectionRequestSchema'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCollectionResponseSchema'
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl "https://api.mem.ai/v2/collections" \
                 --header "Content-Type: application/json" \
                 --header "Authorization: Bearer $MEM_API_KEY" \
                 --data '{
                     "title": "Acme Corp",
                 }'
components:
  schemas:
    CreateCollectionRequestSchema:
      properties:
        id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          description: |-
            Optional caller-provided UUID for the collection.
            If omitted, Mem generates a new UUID.
            If the provided ID already exists, this request returns a conflict.
          title: Id
        title:
          description: |-
            Title for the collection.
            Use a short, stable label suitable for navigation and search.
            Maximum: 1,000 characters (and no more than 1,000 UTF-8 bytes).
          examples:
            - Acme Corp
          maxLength: 1000
          title: Title
          type: string
        description:
          anyOf:
            - description: >-
                Optional descriptive text for collection scope or intent.

                Maximum: 10,000 characters (and no more than 10,000 UTF-8
                bytes).
              maxLength: 10000
              type: string
            - type: 'null'
          description: |-
            Optional longer description of collection scope or intent.
            Maximum: 10,000 characters (and no more than 10,000 UTF-8 bytes).
          examples:
            - >-
              Anything related to Acme Corp; a software company that provides a
              suite of tools for managing customer relationships.
          title: Description
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          description: >-
            Optional creation timestamp (ISO 8601).

            If provided, it must include a timezone offset and cannot be in the
            future.

            If omitted, Mem uses `updated_at` when provided; otherwise current
            server time.
          examples:
            - '2025-04-01T14:30:45Z'
            - '2023-12-15T09:45:30+01:00'
          title: Created At
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          description: >-
            Optional "last updated" timestamp for this write (ISO 8601).

            If provided, it must include a timezone offset and cannot be in the
            future.

            If omitted, Mem uses `created_at` for the initial collection write.
          examples:
            - '2025-04-02T09:15:22Z'
            - '2023-12-15T09:45:30+01:00'
          title: Updated At
      required:
        - title
      title: CreateCollectionRequestSchema
      type: object
    CreateCollectionResponseSchema:
      example:
        created_at: '2025-04-11T04:47:14.457Z'
        description: >-
          Anything related to Acme Corp; a software company that provides a
          suite of tools for managing customer relationships.
        id: 5e29c8a2-c73b-476b-9311-e2579712d4b1
        request_id: api-request-036ed6c7-de00-459f-a89b-43d26aafe522
        title: Acme Corp
        updated_at: '2025-04-11T04:47:19.702Z'
      properties:
        request_id:
          description: Identifier for this API request. Useful for tracing and support.
          title: Request Id
          type: string
        id:
          description: UUID of the created collection.
          format: uuid
          title: Id
          type: string
        title:
          description: Current title of the collection.
          title: Title
          type: string
        description:
          anyOf:
            - type: string
            - type: 'null'
          description: Optional description text currently stored on the collection.
          title: Description
        created_at:
          description: Creation timestamp for the collection in ISO 8601 format.
          format: date-time
          title: Created At
          type: string
        updated_at:
          description: Last modification timestamp for the collection in ISO 8601 format.
          format: date-time
          title: Updated At
          type: string
      required:
        - request_id
        - id
        - title
        - description
        - created_at
        - updated_at
      title: CreateCollectionResponseSchema
      type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````