Zenifra API
The Zenifra API lets you manage projects programmatically: check status, update settings, scale instances, read logs, and inspect network metrics.
Before You Start
You need three identifiers before calling project endpoints:
| Value | Where to use it | Description |
|---|---|---|
| API Key | x-api-key header | Project key used to authenticate the request |
| Organization ID | x-organization-id header | Active organization where the project exists |
| Project ID | :id path parameter | Project ID used in the URL |
x-organization-idis part of the public API contract. Withx-api-key, the API can identify the project from the key; withAuthorization: Bearer, this header selects the active organization and prevents permission errors.
Authentication
Use x-api-key for all endpoints in this section. Also include x-organization-id to keep the organization context explicit, especially for accounts with multiple organizations or shared automations.
Headers
| Header | Required | When to use | Description |
|---|---|---|---|
x-api-key | Yes | All project calls | Project API Key |
x-organization-id | Yes | All documented calls | Active project organization |
Content-Type: application/json | Yes | Requests with a body | Indicates the payload is JSON |
Base URL
All requests should be made to:
https://api.zenifra.com/v1Request Example
curl -X GET "https://api.zenifra.com/v1/project/{id}/metrics" \
-H "x-api-key: your-api-key-here" \
-H "x-organization-id: your-organization-id"Endpoints by Task
Use this overview to quickly choose the right page:
| Task | Page | Main endpoints |
|---|---|---|
| Inspect the project | Project Information | GET /project/:id, PATCH /name, PATCH /description |
| Deploy by image | Update Deploy Image | PATCH /project/:id/image |
| Configure variables | Environment Variables | GET /envs, PATCH /envs |
| Change domain | Domain | PATCH /domain |
| Stop or resume | Lifecycle | PATCH /stop, PATCH /resume |
| Scale instances | Instances | GET /instances, PATCH /instances |
| View previous deploys | Deployments | GET /historic/deployments |
| Observe metrics and logs | Metrics and Logs | GET /metrics, GET /logs |
| Investigate HTTP traffic | Network Metrics | GET /metrics/network/* |
| Change plan | Plan | PATCH /plan |
| Manage storage | Storage | PATCH /storage/size, GET /storage/usage |
HTTP Status Codes
| Code | Description |
|---|---|
200 | Request successful |
400 | Invalid or malformed data |
401 | Invalid or missing API Key |
402 | Current plan does not allow the requested feature |
403 | Organization or permission is insufficient |
404 | Project not found |
409 | Operation not allowed in the current project state |
500 | Internal server error |
Usage Examples
Python
import requests
API_KEY = "your-api-key"
ORGANIZATION_ID = "your-organization-id"
BASE_URL = "https://api.zenifra.com/v1"
headers = {
"x-api-key": API_KEY,
"x-organization-id": ORGANIZATION_ID,
"Content-Type": "application/json"
}
# Get project metrics
response = requests.get(
f"{BASE_URL}/project/507f1f77bcf86cd799439011/metrics",
headers=headers
)
print(response.json())Node.js
const axios = require('axios');
const API_KEY = 'your-api-key';
const ORGANIZATION_ID = 'your-organization-id';
const BASE_URL = 'https://api.zenifra.com/v1';
const headers = {
'x-api-key': API_KEY,
'x-organization-id': ORGANIZATION_ID,
'Content-Type': 'application/json'
};
async function getMetrics(projectId) {
const response = await axios.get(
`${BASE_URL}/project/${projectId}/metrics`,
{ headers }
);
return response.data;
}
getMetrics('507f1f77bcf86cd799439011')
.then(console.log)
.catch(console.error);FAQ
Where do I find my project's API Key and Project ID?
Important: Both the API Key and Project ID are shown only once, at the time of project creation. After this initial screen, it is no longer possible to access them through the console.
Therefore, store this information in a safe place immediately after creating your project.
Can I use the API Key for any project?
Yes, each project has its own API Key. The key grants access only to the specific project it belongs to.
Is x-organization-id always required?
In practice, calls with x-api-key can locate the project from the key itself. Still, include x-organization-id in every automation: it makes the active organization explicit, keeps compatibility with user-token flows, and reduces permission errors in accounts with multiple organizations.
Do the endpoints have rate limiting?
Yes, the API has rate limiting to ensure stability. The current limit is 100 requests per minute per project. If you exceed the limit, you will receive 429 (Too Many Requests) errors.
For higher limits, contact support.