# check_folder_slug_available

Source: https://modulify.ai/docs/api/folders/check-folder-slug-available

Checks whether a folder slug is free in a workspace before update_folder_slug takes it.

- Title: Check a folder slug is free
- Scope: `sites:read`
- Access: Read only
- Endpoint: `POST /v1/check_folder_slug_available`

It answers `ok` when the slug is free and `not-ok` when a folder in the workspace already holds it. It is no use before `create_folder`, which takes no slug and always derives its own.

A slug that is not 3 to 32 characters of letters, numbers and hyphens comes back as an error rather than as taken. Pass `currentSlug` when checking on behalf of an existing folder, and a slug equal to it is answered `ok` without a lookup. See [Folders](https://modulify.ai/docs/projects/folders#rename-a-folder-or-change-its-url).

## Request

Call it with a `POST` to `https://api.modulify.ai/v1/check_folder_slug_available`, sending the inputs below as a JSON object. The token needs the `sites:read` scope.

It only reads and changes nothing, so retrying it is safe.

```bash
curl -X POST https://api.modulify.ai/v1/check_folder_slug_available \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"workspaceId":"WORKSPACE_ID","slug":"SLUG"}'
```

Over MCP, the same method is the [check_folder_slug_available tool](https://modulify.ai/docs/mcp/folders/check-folder-slug-available).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `workspaceId` | string | Yes | The workspace to check within. |
| `slug` | string | Yes | The slug to test. |
| `currentSlug` | string | No | The slug the folder holds today, so it is not counted against itself. |

## Response

Every call answers with the [JSON envelope](https://modulify.ai/docs/api/requests-and-responses#the-response) of `success`, `message`, `data`, `code` and `version`. `data` holds the result described above, and on a method that returns a total, `count` carries it. The [response headers](https://modulify.ai/docs/api/requests-and-responses#headers-on-every-method-call) carry the call's `X-Request-Id` and what is left of your per-minute budget in `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. [Errors](https://modulify.ai/docs/api/errors) explains every status code a call can answer with.