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

# Update Semantic Layer Folder

> Rename a folder or edit its description with an API key or a service account.

Changes `name`, `description`, `icon`, or `hidden`. A new `name` must still be unique among the
folder's siblings, or the request answers `400`.

```bash theme={null}
curl --request PATCH \
  --url "https://api.nekt.ai/api/v1/semantic-layer/folders/FOLDER_ID/" \
  --header "x-api-key: YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"name": "Revenue and churn"}'
```

A personal API token needs what its creator needs: on Growth and Custom, **editor** on the folder
(owners and admins always have it); on Free and Starter, any member may. A service account needs
the **Write the Semantic Layer** capability and the folder in its scope.

A folder the key cannot see answers `404`, not `403`: an id you cannot read is indistinguishable
from one that does not exist.

> [!NOTE]
>
> `parent` is read-only here, so a folder cannot be moved with this endpoint. Moving and reordering
> folders is done in the app.

## Replace a folder

`PUT /api/v1/semantic-layer/folders/{id}/` applies the same rules as `PATCH`, with `name` required in
the body.

## Related

* [Create a folder](https://docs.nekt.com/platform-api/semantic-layer/create-folder.md).
* [Check a folder name](https://docs.nekt.com/platform-api/semantic-layer/check-folder-name.md): before renaming into a name that may be taken.


## OpenAPI

````yaml PATCH /api/v1/semantic-layer/folders/{id}/
openapi: 3.0.3
info:
  title: Nekt API
  version: v1
  description: Nekt API Documentation
  contact:
    email: support@nekt.ai
servers:
  - url: https://api.nekt.ai
security: []
paths:
  /api/v1/semantic-layer/folders/{id}/:
    patch:
      tags:
        - v1
      summary: Update a Semantic Layer folder
      description: >-
        Renames or edits a folder. Requires editor access on it. `parent` is
        read-only here.
      operationId: v1_semantic_layer_folders_partial_update
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          description: A UUID string identifying this Semantic Layer Folder.
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedSemanticLayerFolder'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedSemanticLayerFolder'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedSemanticLayerFolder'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SemanticLayerFolder'
          description: ''
      security:
        - ApiKeyAuth: []
components:
  schemas:
    PatchedSemanticLayerFolder:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          maxLength: 256
        slug:
          type: string
          readOnly: true
        description:
          type: string
          nullable: true
        icon:
          type: string
          nullable: true
          maxLength: 256
        order:
          type: integer
          readOnly: true
          nullable: true
        hidden:
          type: boolean
          description: >-
            Frontend-only: hides the folder from the tree, still reachable in
            the details view. The backend does not filter on it, except in the
            pins listing.
        parent:
          type: string
          format: uuid
          nullable: true
          description: Parent folder. Omit or send null to create at the root.
        created_by:
          type: integer
          readOnly: true
          nullable: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    SemanticLayerFolder:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          maxLength: 256
        slug:
          type: string
          readOnly: true
        description:
          type: string
          nullable: true
        icon:
          type: string
          nullable: true
          maxLength: 256
        order:
          type: integer
          readOnly: true
          nullable: true
        hidden:
          type: boolean
          description: >-
            Frontend-only: hides the folder from the tree, still reachable in
            the details view. The backend does not filter on it, except in the
            pins listing.
        parent:
          type: string
          format: uuid
          nullable: true
          description: Parent folder. Omit or send null to create at the root.
        created_by:
          type: integer
          readOnly: true
          nullable: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - created_at
        - created_by
        - id
        - name
        - order
        - slug
        - updated_at
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: 'API Key authentication. Format: ''x-api-key: api_key'''

````

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