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

# Create a folder

> Create a folder for the workspace.



## OpenAPI

````yaml POST /folders
openapi: 3.0.3
info:
  title: linkutm API
  version: 1.0.0
  description: >-
    REST API for linkutm — short links, UTM tagging, custom domains, folders,
    tags and click analytics.


    Every endpoint documented here is served under
    `https://api.linkutm.com/api/v1`.
servers:
  - url: https://api.linkutm.com/api/v1
    description: Local development
security:
  - ApiKeyAuth: []
  - BearerAuth: []
tags:
  - name: Links
    description: Create, read, update and delete short links, individually or in bulk.
  - name: Domains
    description: Register and verify the custom domains short links are served from.
  - name: Folders
    description: Group links into folders.
  - name: Tags
    description: Label links and manage which links carry which tag.
  - name: Analytics
    description: Click analytics for the workspace and for individual links.
  - name: Imports
    description: Migrate links in from Short.io, Bitly and Rebrandly.
paths:
  /folders:
    post:
      tags:
        - Folders
      summary: Create a folder
      description: Create a folder for the workspace.
      operationId: createFolder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              properties:
                name:
                  type: string
                  maxLength: 50
                  description: Folder name. `Links` is reserved and rejected with `400`.
                  example: Paid campaigns
                color:
                  type: string
                  enum:
                    - red
                    - orange
                    - yellow
                    - green
                    - teal
                    - blue
                    - purple
                    - pink
                    - gray
                  description: The colour of the folder.
                  example: orange
                isDefault:
                  type: boolean
                  description: >-
                    Make this the folder new links land in. Any other default is
                    cleared first.
            example:
              name: Paid campaigns
              color: orange
      responses:
        '201':
          description: The created folder.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Folder'
        '400':
          description: >-
            `name` is empty, longer than 50 characters, the reserved word
            `Links`, or `color` is not one of the listed colours.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                statusCode: 400
                message:
                  - Folder name is required
                error: Bad Request
        '401':
          description: Missing, malformed, expired or revoked credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                statusCode: 401
                message: Invalid or expired API key
                error: Unauthorized
        '403':
          description: The plan does not include Tags & Folders.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                statusCode: 403
                message: >-
                  Tags & Folders feature is not available on your current plan.
                  Please upgrade.
                error: Forbidden
        '409':
          description: A folder with that name already exists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                statusCode: 409
                message: Folder already exists.
                error: Conflict
        '500':
          description: Unexpected server error. Safe to retry with backoff.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                statusCode: 500
                message: Internal server error
components:
  schemas:
    Folder:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          example: Paid campaigns
        color:
          type: string
          nullable: true
          example: '#f97316'
        isDefault:
          type: boolean
          description: New links land here when no `folderId` is sent.
        isSystem:
          type: boolean
          description: System folders cannot be renamed or deleted.
        isActive:
          type: boolean
        parentId:
          type: string
          format: uuid
          nullable: true
          description: Present on the model but unused — folders are flat in practice.
        workspaceId:
          type: string
          format: uuid
        createdById:
          type: string
          format: uuid
          nullable: true
        updatedById:
          type: string
          format: uuid
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        _count:
          type: object
          description: Counts only links that are neither archived nor deleted.
          properties:
            links:
              type: integer
              example: 12
    Error:
      type: object
      description: >-
        Standard NestJS error envelope. `message` is a string for exceptions
        thrown by a service, and an array of strings when the global
        ValidationPipe rejects the body.
      properties:
        statusCode:
          type: integer
          example: 400
        message:
          description: Human-readable reason, or a list of field-level validation errors.
          oneOf:
            - type: string
            - type: array
              items:
                type: string
          example: Link not found
        error:
          type: string
          example: Bad Request
      required:
        - statusCode
        - message
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: 'Workspace API key, sent as `Authorization: Bearer lk_live_…`.'
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Dashboard session token from `POST /auth/login`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.