/** @return CustomDomainResource|null */
public function get(int|float|null $timeout = null): ?arrayReturns the custom domain attached to the workspace, including the DNS records that still need publishing and the current lifecycle status. The SDK unwraps the domain envelope the API returns, so you get the resource or null directly.
null means no domain is attached, which covers both a workspace that never claimed one and a domain that was removed. Absence is not evidence that nothing was ever configured.
records is the authoritative list of what DNS must contain right now, and it changes as the domain moves from ownership proof to certificate validation. Re-read it between steps instead of caching the first response, and poll this method after $envless->workspace->domain->verify() rather than assuming certificate issuance completed inside that call.
Example
use Envless\Envless;
$envless = new Envless();
$domain = $envless->workspace->domain->get();
if ($domain !== null) {
foreach ($domain['records'] as $record) {
echo "{$record['type']} {$record['name']} {$record['value']}", 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
CustomDomainResource with status, records and the verification timestamps, or null when no domain is attached.
Worth knowing
retryAfterSecondsandcanReattempttell you whether another verify call will do real work or return the same state.
Required scopes
workspace:read
Underlying endpoint
GET /workspace/domain
Request and response schema, every error code, and a live playground.
In TypeScript
envless.workspace.domain.get()
The same method in @goenvless/sdk, with the same request, retries and errors.