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

# Create a new collection

Creates a new collection for organizing articles. Collections can be nested by specifying a parent\_id to create sub-collections. The slug must be unique within the knowledge base and URL-safe. If no seo\_title is provided, the regular title is used. Collections are automatically assigned a sort order based on their position within their parent. An icon can be specified using emoji identifiers for visual distinction.


## OpenAPI

````yaml https://api.getfernand.com/openapi.json post /knowledge/collections
openapi: 3.0.3
info:
  title: Fernand API Documentation
  version: '3.0'
  description: This is the documentation for the [Fernand](https://getfernand.com) API.
  termsOfService: https://getfernand.com/terms
  contact:
    name: Fernand Support
    url: https://getfernand.com
    email: support@getfernand.com
  x-logo:
    url: https://app.getfernand.com/images/favicon/icon_128.png
servers:
  - url: https://api.getfernand.com
    description: ''
    x-last-modified: 1764750693905
security:
  - apiKeyHeader: []
externalDocs:
  description: You can access our documentation online by visiting https://api.fernand.help
  url: https://api.fernand.help
paths:
  /knowledge/collections:
    post:
      tags:
        - Knowledge Collections
      summary: Create a new collection
      description: >-
        Creates a new collection for organizing articles. Collections can be
        nested by specifying a parent_id to create sub-collections. The slug
        must be unique within the knowledge base and URL-safe. If no seo_title
        is provided, the regular title is used. Collections are automatically
        assigned a sort order based on their position within their parent. An
        icon can be specified using emoji identifiers for visual distinction.
      operationId: createCollection
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  maxLength: 250
                  description: Display title of the collection (required).
                  example: Getting Started
                slug:
                  type: string
                  maxLength: 250
                  pattern: ^[a-z0-9_-]+$
                  description: >-
                    URL-safe slug for the collection (required, lowercase
                    alphanumeric with dashes/underscores).
                  example: getting-started
                icon:
                  type: string
                  maxLength: 25
                  nullable: true
                  description: Emoji icon identifier for the collection (optional).
                  example: 🚀
                description:
                  type: string
                  maxLength: 1000
                  nullable: true
                  description: Description of the collection content (optional).
                parent_id:
                  type: integer
                  nullable: true
                  description: >-
                    ID of the parent collection for nesting (optional, null for
                    root-level).
                seo_title:
                  type: string
                  maxLength: 250
                  nullable: true
                  description: >-
                    SEO-optimized title for search engines (optional, defaults
                    to title).
                seo_description:
                  type: string
                  maxLength: 1250
                  nullable: true
                  description: SEO-optimized description for search engines (optional).
              required:
                - title
                - slug
      responses:
        '200':
          description: Collection created successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: integer
                    description: Unique identifier for the collection.
                  parent_id:
                    type: integer
                    nullable: true
                    description: ID of the parent collection.
                  title:
                    type: string
                    description: Title of the collection.
                  slug:
                    type: string
                    description: URL-safe slug.
                  description:
                    type: string
                    nullable: true
                    description: Collection description.
                  seo_title:
                    type: string
                    description: SEO-optimized title.
                  seo_description:
                    type: string
                    nullable: true
                    description: SEO-optimized description.
                  icon:
                    type: string
                    nullable: true
                    description: Emoji icon identifier.
                  created:
                    type: string
                    format: date-time
                    description: Creation timestamp.
                  last_updated:
                    type: string
                    format: date-time
                    description: Last update timestamp.
                  sort:
                    type: integer
                    description: Sort order within parent.
        '400':
          description: Invalid input or slug already in use.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
components:
  securitySchemes:
    apiKeyHeader:
      type: apiKey
      description: >-
        Authenticate your account by including your secret key in API requests.

        You can manage your API keys in the
        [Dashboard](https://app.getfernand.com/).


        Authentication to the API is performed by using the HTTP Header
        X-API-Key.
      name: X-API-Key
      in: header
      x-last-modified: 1764750344730

````