Subdomains

Add or reassign a subdomain

Maps a managed subdomain ({name}.run402.com) to a site deployment. The target is resolved server-side from whatever the caller holds: deployment_id (a legacy dpl_ id, or a rel_ / op_ id from a unified-apply commit), release_id, or neither — then the project's live (active) release. A release with no site files (a functions-only API) binds to the project's empty deployment; the host serves the live release's routes. 404 when the named release or operation is not this project's, or the project has never deployed. A first activation that serves site files or routes and has no subdomains slice claims a host automatically (derived from the project name); this route is for choosing a different name or claiming after the fact.

post/subdomains/v1

Request

  • Base URL: https://api.run402.com
  • URL: https://api.run402.com/subdomains/v1
  • Auth: HTTP bearer

Request body

namestring required

Subdomain name (for example, 'myapp' for <subdomain>.run402.com)

deployment_idstring

Optional target: a legacy deployment id (dpl_...), or a rel_... / op_... id the gateway resolves to the site deployment it staged. Omit both this and release_id to bind the project's live release.

release_idstring

Optional release id (rel_...) whose site deployment the subdomain should bind. Omit both this and deployment_id to bind the project's live release.

Response

Subdomain created

namestring
deployment_idstring
release_idstring nullable

On a claim response: the release the bound deployment belongs to, when the target was resolved from a release, an operation, or the live release.

resolved_from'deployment_id' | 'release_id' | 'operation_id' | 'live_release' | 'latest_deployment' nullable

On a claim response: how the bound deployment was chosen.

urlstring uri
deployment_urlstring uri
project_idstring

Run402 project ID. Public IDs are not UUIDs.

created_atstring date-time
updated_atstring date-time

Example response

{
  "project_id": "prj_1741340000_0042"
}

Changes

No recorded changes to this operation across all 1 revision of this API.