Get Project Information

Returns the current project state, including status, plan, domain, instances, storage, port, public deploy settings, and additional information by project type.

GET /project/:id

Path Parameters

ParameterTypeDescription
idstringProject ID (ObjectId)

Headers

HeaderRequiredDescription
x-api-keyYesProject API Key
x-organization-idYesActive project organization
Content-Type: application/jsonConditionalRequired only for PATCH calls

Response

The example below is reduced to highlight the most commonly used fields. The response may also include fields such as github, image, last_deployment, total_amount_used, renew_automatic_contract, custom_domains, network_access, build_failure, updated_at, and created_at.

{
  "status": "success",
  "message": "get deployment with success",
  "data": {
    "name": "my-project",
    "description": "My web application",
    "domain": "my-project.clients.zenifra.com",
    "plan": "basic",
    "status": "running",
    "type_project": "http",
    "instances": 2,
    "storage": {
      "persistent": false,
      "capacity": 1
    },
    "payment_mode": "hourly",
    "port": 3000,
    "additional_info": {
      "current_instances": 2,
      "max_cpu": "1",
      "max_memory": "1Gi"
    }
  }
}

Update Project Name

Changes the project name.

PATCH /project/:id/name

Path Parameters

ParameterTypeDescription
idstringProject ID (ObjectId)

Body

FieldTypeRequiredDescription
namestringYesNew project name (minimum 6 characters, maximum 32, lowercase letters and numbers only, hyphens allowed)

Example

{
  "name": "my-new-project"
}

Response

{
  "status": "success",
  "message": "updated with success"
}

Update Project Description

Changes the project description.

PATCH /project/:id/description

Path Parameters

ParameterTypeDescription
idstringProject ID (ObjectId)

Body

FieldTypeRequiredDescription
descriptionstringNoNew project description (maximum 256 characters)

Response

{
  "status": "success",
  "message": "updated with success"
}

Examples

Update Name

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

Update Description

curl -X PATCH "https://api.zenifra.com/v1/project/507f1f77bcf86cd799439011/description" \
  -H "x-api-key: your-api-key" \
  -H "x-organization-id: your-organization-id" \
  -H "Content-Type: application/json" \
  -d '{"description": "My web application in production"}'

Python

import requests

API_KEY = "your-api-key"
ORGANIZATION_ID = "your-organization-id"
PROJECT_ID = "507f1f77bcf86cd799439011"

headers = {"x-api-key": API_KEY, "x-organization-id": ORGANIZATION_ID}

# Get information
project = requests.get(
    f"https://api.zenifra.com/v1/project/{PROJECT_ID}",
    headers=headers
).json()
print(project)

# Update name
requests.patch(
    f"https://api.zenifra.com/v1/project/{PROJECT_ID}/name",
    headers=headers,
    json={"name": "my-new-project"}
)

# Update description
requests.patch(
    f"https://api.zenifra.com/v1/project/{PROJECT_ID}/description",
    headers=headers,
    json={"description": "My web application in production"}
)