Skip to content

Create a workspace

POST/v1/workspaces

Creates a workspace and makes you its owner. This endpoint needs no X-Workspace-Slug header.

The slug is generated from the name plus the first 8 characters of the new workspace's uid, so Staging becomes something like staging-019a8f2c. Use the returned slug in X-Workspace-Slug for requests in the new workspace. Workspace names do not have to be unique.

Authentication

Send your API key as Authorization: Bearer <token>.

Request body

namestringRequired

Display name. Leading and trailing spaces are trimmed. Must contain at least one letter or digit.

descriptionstring

Optional free-text description.

Response

201

The workspace was created. You are its owner.

successbooleanRequired

true when the request succeeded.

messagestringRequired

Human-readable status message.

dataobject
Show attributes
uidstringRequired

Unique identifier of the workspace. Used in /v1/workspaces/{workspace_uid}/... paths.

namestringRequired

Display name.

slugstringRequired

Unique slug. Send it in X-Workspace-Slug to act in this workspace.

descriptionstringRequired

Free-text description. Empty when not set.

is_defaultbooleanRequired

Whether this is the owner's default workspace, created at signup. It cannot be deleted.

vm_exec_enabledbooleanRequired

Whether running commands on VMs through the API is allowed. See Update workspace settings.

created_atstring (date-time)Required

When the workspace was created.

updated_atstring (date-time)Required

When the workspace was last changed.

rolestring

Your role in the workspace. Omitted when deleting a workspace.

One ofowneradmindeveloperviewer

permissionsarray of strings

The permissions your role grants. Omitted when deleting a workspace.

One ofworkspace.readworkspace.manageresource.writeruntime.connectsecrets.readsecrets.managemembers.manageaudit.readbilling.readbilling.manageworkspace.transferworkspace.delete

member_countintegerRequired

Number of active members. 0 in the response to deleting a workspace.

Errors

StatusMeaning
400Validation failed: invalid request (malformed JSON or name missing), workspace name cannot be empty, or workspace name must contain alphanumeric characters.
401The API key is missing, invalid, expired or revoked.
403You cannot access the workspace, your role does not allow this action, or the account is suspended.

Errors use the standard error format.