Skip to content

domain:get / environment:get report no environment for a domain the dashboard shows as attached #279

Open

Description

@jigar-dhulla

What I see

A custom domain (root domain, www redirect to the bare domain) is shown in the dashboard under the environment's Domains, and the site works over https. The CLI reports it as not attached in two places:

  • cloud domain:get <domain-id> --json -n returns "environmentId": null
  • cloud environment:get <environment> --json -n --fields=domainIds,primaryDomainId returns "domainIds": [] and "primaryDomainId": null

cloud domain:list <environment-id> --json -n does return the domain (its environmentId also shows null), so the API knows the domain belongs to the environment.

Cause, from reading the CLI source and the API docs (not confirmed against a raw API response)

The API returns a relationship only when the request names it in include.

  • Domain environmentId: DomainsResource never sets include, while the API docs list include=environment for GET /domains/{id} and GET /environments/{id}/domains. So Domain::createFromResponse never sees relationships.environment. A fix is open in Request the environment include when fetching domains #280.
  • Environment domainIds: the documented include values for the environment endpoints do not contain domains, so the CLI cannot request them. This needs an API change, or the CLI could fill it from the domain list.
  • Environment primaryDomainId: the CLI already requests primaryDomain, so I don't know why it is still null. It may be that the domain has no primary set because it was added in the dashboard.

Expected

environmentId, domainIds and primaryDomainId match what the dashboard shows.

Notes

  • Hostname, SSL and origin status are all verified, for the root and www.
  • Reproduced on CLI v0.7.0 (latest) and on v0.5.3, installed globally with Composer. One application, one environment.

Edited twice to correct my earlier guesses: domain:list does filter by environment, and the missing domain link is a missing include, not an API omission.

Activity

  1. jigar-dhulla commented on Oct 24, 2026

    @jigar-dhulla
    Author

    Update after checking the live API (read-only calls):

    • environmentId on a domain: confirmed. The API returns the environment link only with include=environment (200, link present), and without it relationships is empty. The fix is in Request the environment include when fetching domains #280.
    • domainIds on an environment: GET /environments/{id}?include=domains returns 400: "Requested include(s) domains are not allowed. Allowed include(s) are application, branch, deployments, currentDeployment, primaryDomain, instances, database, cache, buckets, websocketApplication, secrets." The domains are available from GET /environments/{id}/domains, so I don't know if the missing include is intended. Either the API could allow include=domains, or environment:get could fill domainIds from the domain list.
    • primaryDomainId: GET /environments/{id}?include=primaryDomain returns 200 with primaryDomain: {"data": null}. So the CLI asks correctly and no primary domain is set for this environment (the domain was added in the dashboard). That looks like data, not a bug, unless the dashboard is meant to set one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions