PUT /api/workspaces/{workspace_name}
Path Parameters
Name of the workspace to update. You can find the workspace name on your Mage Pro cluster’s
/apps/workspaces page.Request Body Parameters
All request body parameters are nested under theworkspace object.
The action to perform on the workspace. Supported values:
"stop", "resume", "patch", "add_to_ingress".
See the Supported Actions section below for details on each action and which parameters they support.Optional. YAML configuration string for the container. Used with the
Allows you to update container-level settings such as environment variables, resource limits, and other container configurations. For example, updating environment variables:
patch action.Allows you to update container-level settings such as environment variables, resource limits, and other container configurations. For example, updating environment variables:
Optional. Dictionary/object containing lifecycle configuration. Used with the
patch action.
Defines lifecycle management policies including termination policies, pre-start scripts, and post-start hooks.
Structure:Optional. Whether to update workspace settings with the current cluster’s environment variables. Used with the
patch action.
Set to true to sync the workspace configuration with the cluster-level environment variables.
When enabled, the workspace will inherit environment variables from the cluster configuration.Supported Actions
Theaction field determines what operation will be performed on the workspace. Each action supports different parameters and cluster types.
stop
Stops a running workspace. The workspace metadata is preserved, but the cloud instance is stopped or paused.
Supported cluster types: K8S, Docker
Required parameters:
workspace.action:"stop"
resume
Resumes a stopped workspace, restarting the cloud instance.
Supported cluster types: K8S, Docker
Required parameters:
workspace.action:"resume"
patch
Applies partial updates to the workspace configuration, such as updating environment variables, container settings, or lifecycle configurations.
Supported cluster types: K8S, Docker
Required parameters:
workspace.action:"patch"
workspace.container_config(string) - YAML configuration string for the containerworkspace.lifecycle_config(object) - Dictionary containing lifecycle configuration (termination policy, pre-start scripts, post-start hooks)workspace.update_workspace_settings(boolean) - Whether to sync workspace settings with cluster-level environment variables
add_to_ingress
Adds the workspace service to the Kubernetes ingress configuration, making it accessible via the ingress URL.
Supported cluster types: Kubernetes (K8S) only
Required parameters:
workspace.action:"add_to_ingress"