> ## 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.

# Set the default folder

> Set the folder new links are filed under.



## OpenAPI

````yaml POST /folders/set-default
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/set-default:
    post:
      tags:
        - Folders
      summary: Set the default folder
      description: Set the folder new links are filed under.
      operationId: setDefaultFolder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - folderId
              properties:
                folderId:
                  type: string
                  format: uuid
                  nullable: true
            example:
              folderId: 6d40…
      responses:
        '201':
          description: The new default folder, or `null` when the default was cleared.
          content:
            application/json:
              schema:
                nullable: true
                allOf:
                  - $ref: '#/components/schemas/Folder'
        '400':
          description: >-
            `folderId` is neither a UUID nor `null`, or the folder belongs to
            another workspace.
          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: >-
            Authenticated, but the role, plan or workspace membership does not
            allow this call.
          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
        '404':
          description: The resource does not exist, or belongs to another workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                statusCode: 404
                message: Folder not found
                error: Not Found
        '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.