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

# Update a folder

> Update a folder.



## OpenAPI

````yaml PATCH /folders/{id}
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/{id}:
    patch:
      tags:
        - Folders
      summary: Update a folder
      description: Update a folder.
      operationId: updateFolder
      parameters:
        - name: id
          in: path
          required: true
          description: Folder ID.
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              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 2026
      responses:
        '200':
          description: The updated folder.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Folder'
        '400':
          description: >-
            Validation failed, or a required header or query parameter is
            missing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                statusCode: 400
                message:
                  - Folder name cannot be empty
                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, or this is a system
            folder.
          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
        '409':
          description: Conflicts with a resource that 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.