Subdomain Management API
The Subdomain Management API allows you to manage subdomains within the unified resource system. Subdomains represent logical divisions of a domain (e.g., blog.example.com, support.example.com, docs.example.com).Base URL
All subdomain endpoints are prefixed with:projectSlug- The slug of your projectenvironmentSlug- The slug of your environment
Create Subdomain
Create a new subdomain resource. Endpoint:POST /api/:projectSlug/:environmentSlug/subdomains
Authentication: Required
Request Body:
400 Bad Request: Missing required fields, invalid subdomain name format, or duplicate subdomain401 Unauthorized: Missing or invalid authentication token403 Forbidden: Project access denied404 Not Found: Project or environment not found500 Internal Server Error: Failed to create subdomain
- Must contain only alphanumeric characters and hyphens
- Cannot start or end with a hyphen
- Case-insensitive (will be normalized to lowercase)
List Subdomains
Get all subdomains for a project and environment. Endpoint:GET /api/:projectSlug/:environmentSlug/subdomains
Authentication: Required
Example Request:
401 Unauthorized: Missing or invalid authentication token404 Not Found: Project or environment not found500 Internal Server Error: Failed to retrieve subdomains
Get Subdomain
Get details of a specific subdomain. Endpoint:GET /api/:projectSlug/:environmentSlug/subdomains/:id
Authentication: Required
Parameters:
id(path) - The subdomain ID
400 Bad Request: Invalid subdomain ID401 Unauthorized: Missing or invalid authentication token403 Forbidden: Access denied to this subdomain404 Not Found: Subdomain not found500 Internal Server Error: Failed to retrieve subdomain
Delete Subdomain
Subdomain deletion is performed only via the unified resources API:DELETE /api/:projectSlug/:environmentSlug/resources/:resourceId
401 Unauthorized: Missing or invalid authentication token403 Forbidden: Access denied404 Not Found: Resource not found500 Internal Server Error: Failed to delete subdomain
Subdomains in Unified Resources API
Subdomains are also included in the unified resources API endpoints:GET /api/:projectSlug/:environmentSlug/resources?type=subdomain- List subdomains for a specific project and environment
Notes
-
Subdomain vs DNS Records: Subdomains are logical resource entities in the system. They do not automatically create DNS records. To make a subdomain functional, you need to:
- Create DNS records (A, AAAA, or CNAME) pointing to your resources
- Use the DNS Management API or connect the subdomain to other resources via resource connections
-
Duplicate Prevention: Each subdomain name + parent domain combination must be unique within a project and environment. Attempting to create a duplicate will result in a
400 Bad Requesterror. - Name Normalization: Subdomain names are normalized to lowercase when stored. The name “Blog” will be stored as “blog”.
- Resource Connections: Subdomains can be connected to other resources (for example static websites) via the Resource Connections API to establish relationships between subdomains and their target resources.
- Position Coordinates: Position coordinates (positionX, positionY) are used for visual representation on canvas views. They are optional and can be updated later.