deploy.project-domain.put

Set a project’s wildcard domain for apps

PUT /deploy/api/project-domainIAM deploy:PutProjectDomainChanges state

One per project, named by the X-EWS-Project header (its slug); without it, the Default project. The domain (apps.example.com) must be in one of the organization’s hosted zones, delegated to the platform’s nameservers: the platform writes an ALIAS <app slug>.<domain> for every app of the project (and for each new app, or one moved into it), never over a record that is already there, and issues one certificate for *.<domain> over DNS-01 within a minute or two; it is renewed 30 days before it expires. An app moved out of the project loses its name there. An app behind a load balancer is not served at the domain. Previews are not. Setting a different domain removes the old one’s records first. Two projects cannot share a domain, or use one under the other.

Request syntax

PUT /deploy/api/project-domain
{
  "domain": "object"
}

Request body

  • domainRequired

    object

    The domain, e.g. apps.example.com; every app of the project answers at <app slug>.<domain>

    Constraints: JSON

Response

200 with `data`: the domain, its records written and its certificate issuing. 400 when the domain is not in one of your hosted zones; 409 when another project uses it, or a domain over or under it.

A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.

Fields of data

  • projectAlways

    string

    Slug of the project whose apps answer under the domain
  • projectNameAlways

    string

    Name of that project
  • domainAlways

    string

    The domain: every app of the project answers at <app slug>.<domain>
  • zoneIdAlways

    string

    The hosted zone the domain is in, where the records are written
  • zoneNameAlways

    string

    Name of that hosted zone
  • certificateAlways

    object

    The one certificate, for *.<domain>, every app of the project serves
  • certificate.​statusAlways

    one of issuing, active, failed

    issuing: being issued (a minute or two); active; failed: see error
  • certificate.​notAfterAlways

    string, may be null

    When the certificate expires; null until issued
  • certificate.​errorAlways

    string, may be null

    Why issuing failed; null otherwise
  • recordsAlways

    array of object

    Every app of the project and its name under the domain
  • records[].​appIdAlways

    string

    The app
  • records[].​appNameAlways

    string

    Its name
  • records[].​nameAlways

    string

    Where it answers: <app slug>.<domain>
  • records[].​stateAlways

    one of ok, pending, taken, load_balanced

    ok: answering; pending: the record is written on the next pass; taken: the name already has a record of yours, left alone; load_balanced: an app behind a load balancer is not served at the domain

Checked against the handlers: every route test validates their answers against this schema.

Errors

  • 400The request does not pass the schema above. The body is { "error": …, "issues": […] }, one issue per field.
  • 401No credentials, or an access key that is unknown, revoked or expired.
  • 403The caller's policies do not allow deploy:PutProjectDomain on this resource. The body names the action and the resource, and the refusal is recorded in the audit log.
  • 404The resource does not exist in your organization.

Examples

The required parameters only, with example values. Replace id and the other placeholders with your own.

dcloud deploy project-domain put --domain '{}'

Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_deploy_project-domain_put.