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

# Rename or Move Folder

> Renames a folder, moves it to a different parent, or both. Send only the
fields you want to change.

Set `parentFolderId` to a folder ID to move the folder, or to `null` to
move it to the root level.

**Required permission:** `company.file:update`




## OpenAPI

````yaml /openapi/generated-external-api.yaml patch /api/v1/external/companies/{companyId}/folders/{folderId}
openapi: 3.0.3
info:
  title: AI Insurance External API
  description: External API for AI Insurance platform
  version: 1.0.0
  contact:
    email: support@aiinsurance.io
servers:
  - url: https://app.aiinsurance.io
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /api/v1/external/companies/{companyId}/folders/{folderId}:
    patch:
      tags:
        - Company Files
      summary: Rename or Move Folder
      description: |
        Renames a folder, moves it to a different parent, or both. Send only the
        fields you want to change.

        Set `parentFolderId` to a folder ID to move the folder, or to `null` to
        move it to the root level.

        **Required permission:** `company.file:update`
      operationId: updateFolder
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/folderId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: New folder name (non-empty)
                parentFolderId:
                  type: string
                  format: uuid
                  nullable: true
                  description: New parent folder ID, or null to move to root
            examples:
              rename:
                summary: Rename folder
                value:
                  name: Archived Claims
              move:
                summary: Move folder under a new parent
                value:
                  parentFolderId: 550e8400-e29b-41d4-a716-446655440099
              moveToRoot:
                summary: Move folder to root level
                value:
                  parentFolderId: null
      responses:
        '200':
          description: Folder updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Folder'
              examples:
                success:
                  summary: Folder renamed
                  value:
                    id: 550e8400-e29b-41d4-a716-446655440001
                    name: Archived Claims
                    parentFolderId: null
                    category: null
                    createdAt: '2026-01-15T10:30:00.000Z'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Folder not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                notFound:
                  summary: Folder does not exist
                  value:
                    error:
                      code: folder-not-found
                      message: Folder not found
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    companyId:
      name: companyId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Company identifier
    folderId:
      name: folderId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Folder identifier
  schemas:
    Folder:
      type: object
      description: A folder in the company file hierarchy
      properties:
        id:
          type: string
          format: uuid
          description: Folder identifier
        name:
          type: string
          description: Folder name
        category:
          type: string
          nullable: true
          description: Optional category label
        parentFolderId:
          type: string
          format: uuid
          nullable: true
          description: Parent folder ID, or null for root-level folders
        createdAt:
          type: string
          format: date-time
          nullable: true
          description: When the folder was created (ISO 8601)
    ErrorResponse:
      type: object
      description: Standard error response for all external API endpoints
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Machine-readable error code
              example: VALIDATION_ERROR
            message:
              type: string
              description: Human-readable error message
              example: 'submissionId: Required field is missing'
            details:
              type: array
              description: Additional details for validation errors (field-level errors)
              items:
                type: object
                properties:
                  field:
                    type: string
                    description: The field that caused the error
                    example: submissionId
                  message:
                    type: string
                    description: Description of the field error
                    example: Required field is missing
  responses:
    Unauthorized:
      description: Unauthorized - Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingApiKey:
              summary: Missing API key
              value:
                error:
                  code: UNAUTHORIZED
                  message: Authorization header is required
            bearerTokenNotAllowed:
              summary: Bearer token used instead of API key
              value:
                error:
                  code: UNAUTHORIZED
                  message: External API endpoints require API key authentication
    Forbidden:
      description: Forbidden - Insufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            insufficientPermissions:
              summary: Insufficient permissions
              value:
                error:
                  code: FORBIDDEN
                  message: Insufficient permissions to perform this action
    InternalServerError:
      description: Internal Server Error - Unexpected error occurred
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            internalError:
              summary: Unexpected server error
              value:
                error:
                  code: INTERNAL_ERROR
                  message: An unexpected error occurred. Please try again later.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        API key authentication. Include your API key in the Authorization
        header.

````