/** @return RemovedDomainResource */
public function remove(int|float|null $timeout = null): arrayDetaches 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 returns 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
use Envless\Envless;
$envless = new Envless();
$result = $envless->workspace->domain->remove();
echo $result['removed'] ? 'removed' : 'nothing to remove', PHP_EOL;Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
$timeout | int|float | No | Seconds each attempt of this call may take, the response body included, before it throws Envless\Exception\NetworkException with isTimeout() true. Overrides the client's timeout for this call, and 0 turns the limit off. |
Returns
RemovedDomainResource whose removed flag confirms the detach.
Worth knowing
- After a removal
$envless->workspace->domain->get()returnsnull, 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 TypeScript
envless.workspace.domain.remove()
The same method in @goenvless/sdk, with the same request, retries and errors.