/v1/workspacesCreates 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
namestringRequiredDisplay name. Leading and trailing spaces are trimmed. Must contain at least one letter or digit.
descriptionstringOptional free-text description.
Response
The workspace was created. You are its owner.
successbooleanRequiredtrue when the request succeeded.
messagestringRequiredHuman-readable status message.
dataobjectShow attributesHide attributes
uidstringRequiredUnique identifier of the workspace. Used in /v1/workspaces/{workspace_uid}/... paths.
namestringRequiredDisplay name.
slugstringRequiredUnique slug. Send it in X-Workspace-Slug to act in this workspace.
descriptionstringRequiredFree-text description. Empty when not set.
is_defaultbooleanRequiredWhether this is the owner's default workspace, created at signup. It cannot be deleted.
vm_exec_enabledbooleanRequiredWhether running commands on VMs through the API is allowed. See Update workspace settings.
created_atstring (date-time)RequiredWhen the workspace was created.
updated_atstring (date-time)RequiredWhen the workspace was last changed.
rolestringYour role in the workspace. Omitted when deleting a workspace.
One ofowneradmindeveloperviewer
permissionsarray of stringsThe permissions your role grants. Omitted when deleting a workspace.
One ofworkspace.readworkspace.manageresource.writeruntime.connectsecrets.readsecrets.managemembers.manageaudit.readbilling.readbilling.manageworkspace.transferworkspace.delete
member_countintegerRequiredNumber of active members. 0 in the response to deleting a workspace.
Errors
| Status | Meaning |
|---|---|
400 | Validation failed: invalid request (malformed JSON or name missing), workspace name cannot be empty, or workspace name must contain alphanumeric characters. |
401 | The API key is missing, invalid, expired or revoked. |
403 | You cannot access the workspace, your role does not allow this action, or the account is suspended. |
Errors use the standard error format.