Logo ZenifraZenifra

Project Domain

Learn how to update your project's domain/subdomain via API.

Update Project Domain

Changes the project subdomain on the Zenifra platform.

PATCH /project/:id/domain

Path Parameters

ParameterTypeDescription
idstringProject ID (ObjectId)

Body

FieldTypeRequiredDescription
domainstringYesNew subdomain (minimum 6 characters, maximum 32, lowercase letters only, hyphens allowed)

Example

{
  "domain": "my-subdomain"
}

Response

{
  "status": "success",
  "data": {
    "domain": "my-subdomain.zenifra.com"
  }
}

Examples

curl -X PATCH "https://api.zenifra.com/v1/project/507f1f77bcf86cd799439011/domain" \
  -H "x-api-key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"domain": "my-subdomain"}'

Python

import requests

API_KEY = "your-api-key"
PROJECT_ID = "507f1f77bcf86cd799439011"

response = requests.patch(
    f"https://api.zenifra.com/v1/project/{PROJECT_ID}/domain",
    headers={"x-api-key": API_KEY},
    json={"domain": "my-subdomain"}
)
print(response.json())

Domain Rules

  • Minimum of 6 characters
  • Maximum of 32 characters
  • Lowercase letters and hyphens only
  • Cannot start or end with hyphen