Workspace

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

Run one verification pass on the domain

php
/** @return CustomDomainResource|null */
public function verify(
    bool $reattempt = false,
    int|float|null $timeout = null,
): ?array

Runs a single verification pass against the DNS you published. A domain that is not ready yet is not an error: the call returns the new status and failureReason, so branch on status instead of on whether the call threw.

Verification is two staged. The Envless ownership TXT record has to resolve first, and only then is the certificate requested and its own validation records appear in records. A full setup therefore needs at least two calls with a DNS publish between them.

Calls are debounced. Verifying inside the window returns the current state untouched and retryAfterSeconds says when the next real attempt is allowed. Attempts are also capped, and once the cap is spent the only way forward is to remove the domain and claim it again.

Example

php
use Envless\Envless;

$envless = new Envless();

$domain = $envless->workspace->domain->verify();

if ($domain !== null && $domain['status'] !== 'active') {
    echo "{$domain['status']} {$domain['failureReason']}", PHP_EOL;
    echo $domain['retryAfterSeconds'] ?? 0, PHP_EOL;
}

Parameters

ParameterTypeRequiredDescription
$reattemptboolNoForces a fresh certificate attempt after a failure instead of only re-reading the current state.
$timeoutint|floatNoSeconds 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 reflecting the pass just run, or null when the API returns no domain.

Worth knowing

  • This method takes only options. There is no positional hostname, because the domain is whichever one the workspace claimed.
  • reattempt is always sent, defaulting to false when you omit it.
  • Status 409 with domain.attempt_limit is terminal for that claim. Remove the domain and claim it again.

Required scopes

workspace:write

Underlying endpoint

POST /workspace/domain/verify

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

In TypeScript

envless.workspace.domain.verify()

The same method in @goenvless/sdk, with the same request, retries and errors.