Changes the project subdomain on the Zenifra platform.
This operation only applies to HTTP projects with exposure: "public". Private projects do not have a public domain; change the project exposure to public before configuring a subdomain or custom domains.
PATCH /project/:id/domain
Parameter Type Description idstring Project ID (ObjectId)
Header Required Description x-api-keyYes Project API Key x-organization-idYes Active project organization Content-Type: application/jsonYes Required because the request has a JSON body
Field Type Required Description domainstring Yes New subdomain (6–54 characters, lowercase letters, numbers, and internal hyphens)
{
"domain" : "my-subdomain"
}
{
"status" : "success" ,
"message" : "updated with success"
}
curl -X PATCH "https://api.zenifra.com/v1/project/507f1f77bcf86cd799439011/domain" \
-H "x-api-key: your-api-key" \
-H "x-organization-id: your-organization-id" \
-H "Content-Type: application/json" \
-d '{"domain": "my-subdomain"}'
import requests
API_KEY = "your-api-key"
ORGANIZATION_ID = "your-organization-id"
PROJECT_ID = "507f1f77bcf86cd799439011"
response = requests.patch(
f "https://api.zenifra.com/v1/project/ {PROJECT_ID} /domain" ,
headers = { "x-api-key" : API_KEY , "x-organization-id" : ORGANIZATION_ID },
json = { "domain" : "my-subdomain" }
)
print (response.json())
Minimum of 6 characters
Maximum of 54 characters
Lowercase letters, numbers, and internal hyphens only
Cannot start or end with hyphen
The requested subdomain is reserved exactly as provided; if it is already in use, the API returns 409 instead of silently renaming it
The resulting Zenifra default domain uses the clients.zenifra.com zone
Private HTTP projects (exposure: "private") do not receive a subdomain and cannot update a public domain