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

# Check Semantic Layer Folder Name

> Whether a folder name is free, and a free one to use when it is not.

Folder names are unique among siblings. Ask before creating or renaming to avoid a `400`: send the
`name` and the `parent` it would live in (omit `parent` for the root).

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

```json theme={null}
{
  "name": "Revenue",
  "parent": null,
  "available": false,
  "available_name": "Revenue 2"
}
```

`available_name` is the name itself when it is free, or the first free `<name> N` when it is not.
The check counts every sibling, including folders the key cannot see, because they would still
collide.

A service account needs the **Write the Semantic Layer** capability, and `parent` must be in its
scope.

## Related

* [Create a folder](https://docs.nekt.com/platform-api/semantic-layer/create-folder.md) and [Update a folder](https://docs.nekt.com/platform-api/semantic-layer/update-folder.md).


## OpenAPI

````yaml POST /api/v1/semantic-layer/folders/check-name-availability/
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/check-name-availability/:
    post:
      tags:
        - v1
      summary: Check a Semantic Layer folder name
      description: >-
        Whether `name` is free under `parent` (the root when omitted), and a
        free name to use when it is not.
      operationId: v1_semantic_layer_folders_check_name_availability_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckSemanticLayerFolderName'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CheckSemanticLayerFolderName'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CheckSemanticLayerFolderName'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckSemanticLayerFolderName'
          description: ''
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CheckSemanticLayerFolderName:
      type: object
      description: >-
        Answers "can I call it this?" AND "then what should I call it?".


        The frontend calls this before opening the rename input, so the user is
        never bounced

        by a 400 they could not have predicted.
      properties:
        name:
          type: string
          maxLength: 256
        parent:
          type: string
          format: uuid
          nullable: true
        available:
          type: boolean
          readOnly: true
        available_name:
          type: string
          readOnly: true
      required:
        - available
        - available_name
        - name
  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.