docs: document workspace naming rules and restrictions (#17312)

closes #12047 


[preview](https://coder.com/docs/@12047-workspace-names/user-guides/workspace-management)

---------

Co-authored-by: EdwardAngert <17991901+EdwardAngert@users.noreply.github.com>
This commit is contained in:
Edward Angert
2025-04-15 14:11:05 -04:00
committed by GitHub
co-authored by EdwardAngert
parent b0fe626250
commit 0cd531dd33
5 changed files with 21 additions and 3 deletions
+1 -1
View File
@@ -11433,7 +11433,7 @@ const docTemplate = `{
}
},
"codersdk.CreateWorkspaceRequest": {
"description": "CreateWorkspaceRequest provides options for creating a new workspace. Only one of TemplateID or TemplateVersionID can be specified, not both. If TemplateID is specified, the active version of the template will be used.",
"description": "CreateWorkspaceRequest provides options for creating a new workspace. Only one of TemplateID or TemplateVersionID can be specified, not both. If TemplateID is specified, the active version of the template will be used. Workspace names: - Must start with a letter or number - Can only contain letters, numbers, and hyphens - Cannot contain spaces or special characters - Cannot be named ` + "`" + `new` + "`" + ` or ` + "`" + `create` + "`" + ` - Must be unique within your workspaces - Maximum length of 32 characters",
"type": "object",
"required": [
"name"
+1 -1
View File
@@ -10193,7 +10193,7 @@
}
},
"codersdk.CreateWorkspaceRequest": {
"description": "CreateWorkspaceRequest provides options for creating a new workspace. Only one of TemplateID or TemplateVersionID can be specified, not both. If TemplateID is specified, the active version of the template will be used.",
"description": "CreateWorkspaceRequest provides options for creating a new workspace. Only one of TemplateID or TemplateVersionID can be specified, not both. If TemplateID is specified, the active version of the template will be used. Workspace names: - Must start with a letter or number - Can only contain letters, numbers, and hyphens - Cannot contain spaces or special characters - Cannot be named `new` or `create` - Must be unique within your workspaces - Maximum length of 32 characters",
"type": "object",
"required": ["name"],
"properties": {
+7
View File
@@ -207,6 +207,13 @@ type CreateTemplateRequest struct {
// @Description CreateWorkspaceRequest provides options for creating a new workspace.
// @Description Only one of TemplateID or TemplateVersionID can be specified, not both.
// @Description If TemplateID is specified, the active version of the template will be used.
// @Description Workspace names:
// @Description - Must start with a letter or number
// @Description - Can only contain letters, numbers, and hyphens
// @Description - Cannot contain spaces or special characters
// @Description - Cannot be named `new` or `create`
// @Description - Must be unique within your workspaces
// @Description - Maximum length of 32 characters
type CreateWorkspaceRequest struct {
// TemplateID specifies which template should be used for creating the workspace.
TemplateID uuid.UUID `json:"template_id,omitempty" validate:"required_without=TemplateVersionID,excluded_with=TemplateVersionID" format:"uuid"`
+1 -1
View File
@@ -1476,7 +1476,7 @@ None
}
```
CreateWorkspaceRequest provides options for creating a new workspace. Only one of TemplateID or TemplateVersionID can be specified, not both. If TemplateID is specified, the active version of the template will be used.
CreateWorkspaceRequest provides options for creating a new workspace. Only one of TemplateID or TemplateVersionID can be specified, not both. If TemplateID is specified, the active version of the template will be used. Workspace names: - Must start with a letter or number - Can only contain letters, numbers, and hyphens - Cannot contain spaces or special characters - Cannot be named `new` or `create` - Must be unique within your workspaces - Maximum length of 32 characters
### Properties
+11
View File
@@ -34,6 +34,17 @@ coder create --template="<templateName>" <workspaceName>
coder show <workspace-name>
```
### Workspace name rules and restrictions
| Constraint | Rule |
|------------------|--------------------------------------------|
| Start/end with | Must start and end with a letter or number |
| Character types | Letters, numbers, and hyphens only |
| Length | 1-32 characters |
| Case sensitivity | Case-insensitive (lowercase recommended) |
| Reserved names | Cannot use `new` or `create` |
| Uniqueness | Must be unique within your workspaces |
## Workspace filtering
In the Coder UI, you can filter your workspaces using pre-defined filters or