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 a user token or an organization API Key, together with the organization context and project ID:
| Value | Where to use it | Description |
|---|---|---|
| Token or API Key | Authorization or the accepted authentication header | Session or organization credential |
| Organization ID | x-organization-id header | Active organization where the project exists |
| Project ID | :id path parameter | Project ID used in the URL |
Minimum scopes by task
An owner session has full access. assistant, member, and API Keys need the scope listed for the correct resource:
| Task | Minimum scope |
|---|---|
| Create an HTTP project | project.create on organization:* |
| Create a database | database.create on organization:* |
| Create Cache, Queue, or Valkey | managed_service.create on organization:* |
| Read a project | project.read on project:<project-id> |
| Metrics and storage usage | project.metrics.read on project:<project-id> |
| Logs and builds | project.logs.read on project:<project-id> |
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
For user-authenticated calls, use Authorization: Bearer <token>. For automation, use an organization API Key in the API key header accepted by the route and include x-organization-id. Each endpoint page specifies the minimum scope and applicable authentication format.
Headers
| Header | Required | When to use | Description |
|---|---|---|---|
x-api-key or equivalent credential | Route-dependent | All protected calls | Organization API Key or legacy project credential, when documented |
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 and change project exposure | Project Information | GET /project/:id, PATCH /name, PATCH /description, PATCH /project/:id/exposure |
| 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 |
| Follow GitHub builds | GitHub Builds | POST /github/deploy, GET /github/builds, GET /github/builds/:buildId/logs |
| 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.