Workspace

envless.workspace.domain.remove()

Detach the custom domain and certificate

ts
domain.remove(options?: RequestScope): Promise<RemovedDomainResource>

Detaches the custom domain and tears down its certificate. The workspace falls back to its envless.cloud subdomain immediately, which breaks any exposed environment URL built on the custom hostname.

Removing a domain that was never claimed succeeds and does nothing, so this is safe to call defensively in teardown scripts. Unlike the other three domain methods this one resolves the payload as sent: a RemovedDomainResource, never a domain resource.

If the certificate cannot be detached at the edge the call fails with status 500 and the domain is left in the removing state. Call again to resume from there rather than re-claiming the hostname.

Example

ts
const result = await envless.workspace.domain.remove()

console.log(result.removed)

Parameters

ParameterTypeRequiredDescription
options.signalAbortSignalNoCancels the request.

Returns

RemovedDomainResource whose removed flag confirms the detach.

Worth knowing

  • After a removal envless.workspace.domain.get resolves null, the same as a workspace that never claimed a domain.

Required scopes

workspace:write

Underlying endpoint

DELETE /workspace/domain

Request and response schema, every error code, and a live playground.

In Python

envless.workspace.domain.remove()

The same method in envless-sdk, the Python SDK, with the same request, retries and errors.

In Ruby

Envless.workspace.domain.remove

The same method in envless-sdk, the Ruby gem, with the same request, retries and errors.

In PHP

$envless->workspace->domain->remove()

The same method in envless/sdk, the PHP SDK, with the same request, retries and errors.