def update(
patch: WorkspacePatch,
*,
timeout: float | None = None,
) -> UpdatedWorkspaceResourceasync def update(
patch: WorkspacePatch,
*,
timeout: float | None = None,
) -> UpdatedWorkspaceResourceRenames the workspace, changes its slug, or toggles virtual environments. Each field is optional and applied on its own, and an empty patch is accepted and returns the workspace unchanged.
Only name, slug and virtualEnvsEnabled are read. Any other key in the patch is dropped silently rather than rejected, so a misspelled field looks like a successful no-op. The icon cannot be set through the API at all.
Changing slug rewrites every dashboard URL and every exposed environment URL for the workspace, and the old slug is neither reserved nor redirected, so another workspace can claim it. The returned UpdatedWorkspaceResource omits createdAt, which envless.workspace.get does return.
Example
from envless import envless
workspace = envless.workspace.update(
{'name': 'Acme Platform', 'virtualEnvsEnabled': True}
)
print(workspace['slug'], workspace['virtualEnvsEnabled'])import asyncio
from envless import AsyncEnvless
async def main() -> None:
async with AsyncEnvless() as envless:
workspace = await envless.workspace.update(
{'name': 'Acme Platform', 'virtualEnvsEnabled': True}
)
print(workspace['slug'], workspace['virtualEnvsEnabled'])
asyncio.run(main())Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
patch['name'] | str | No | New display name for the workspace. |
patch['slug'] | str | No | New slug, limited to lowercase letters, digits and single hyphens. |
patch['virtualEnvsEnabled'] | bool | No | Workspace half of the two flag gate on exposed environments. |
timeout | float | No | Seconds each attempt of this call may take, the response body included, before it raises EnvlessNetworkError with is_timeout set. Overrides the client's timeout for this call, and 0 turns the limit off. |
Returns
UpdatedWorkspaceResource with id, name, slug, icon and virtualEnvsEnabled.
Worth knowing
- Setting
virtualEnvsEnabledtoTrueexposes nothing by itself. Every environment still needs its own expose opt-in. - Setting
virtualEnvsEnabledtoFalseis a kill switch: every exposed feed in the workspace stops serving at once. - A slug another workspace already owns fails with status 409 and the generic
request.conflictcode, so read the message for the reason.
Required scopes
workspace:write
Underlying endpoint
PATCH /workspace
Request and response schema, every error code, and a live playground.
In TypeScript
envless.workspace.update()
The same method in @goenvless/sdk, with the same request, retries and errors.