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

# Create Semantic Layer Folder

> Add a folder to the Semantic Layer tree with an API key or a service account.

Send `parent` to create the folder inside another one, or omit it (or send `null`) to create it at
the root. Folder names are unique among siblings: a taken name answers `400`, so
[check the name](https://docs.nekt.com/platform-api/semantic-layer/check-folder-name.md) first when it may collide.

```bash theme={null}
curl --request POST \
  --url "https://api.nekt.ai/api/v1/semantic-layer/folders/" \
  --header "x-api-key: YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "name": "Revenue",
    "description": "Definitions used by the finance dashboards.",
    "parent": "b8c5e1e3-6d02-4f45-ad20-8f4b6e2d0e13"
  }'
```

Who may create depends on the key:

| Key | Where it may create |
| - | - |
| Personal API token | Where **the person who created it** may. On Growth and Custom, owners and admins anywhere; a member needs **editor** on `parent`, or on the root when `parent` is omitted. On Free and Starter, every member anywhere. |
| [Service account](https://docs.nekt.com/workspaces/service-accounts.md) | Needs the **Write the Semantic Layer** capability and the **Context layer** area in its access. With a **Custom scope**, `parent` must be a selected folder or one inside it; any other folder answers `400`, the same as a folder that does not exist. |

A folder a service account creates is added to its own scope, so it can keep working in it: a
folder it creates at the root becomes part of its selection.

## Related

* [Update a folder](https://docs.nekt.com/platform-api/semantic-layer/update-folder.md) and [Delete a folder](https://docs.nekt.com/platform-api/semantic-layer/delete-folder.md).
* [List Semantic Layer Folders](https://docs.nekt.com/platform-api/permissions/semantic-layer/list-folders.md): to find folder ids.
* [Create a document](https://docs.nekt.com/platform-api/semantic-layer/create.md): to fill the folder.


## OpenAPI

````yaml POST /api/v1/semantic-layer/folders/
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/:
    post:
      tags:
        - v1
      summary: Create a Semantic Layer folder
      description: >-
        Creates a folder inside `parent`, or at the root when `parent` is
        omitted. Requires editor access on the destination. Folder names are
        unique among siblings.
      operationId: v1_semantic_layer_folders_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SemanticLayerFolder'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SemanticLayerFolder'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SemanticLayerFolder'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SemanticLayerFolder'
          description: ''
      security:
        - ApiKeyAuth: []
components:
  schemas:
    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.