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:

ValueWhere to use itDescription
API Keyx-api-key headerProject key used to authenticate the request
Organization IDx-organization-id headerActive organization where the project exists
Project ID:id path parameterProject ID used in the URL

x-organization-id is part of the public API contract. With x-api-key, the API can identify the project from the key; with Authorization: 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

HeaderRequiredWhen to useDescription
x-api-keyYesAll project callsProject API Key
x-organization-idYesAll documented callsActive project organization
Content-Type: application/jsonYesRequests with a bodyIndicates the payload is JSON

Base URL

All requests should be made to:

https://api.zenifra.com/v1

Request 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:

TaskPageMain endpoints
Inspect the projectProject InformationGET /project/:id, PATCH /name, PATCH /description
Deploy by imageUpdate Deploy ImagePATCH /project/:id/image
Configure variablesEnvironment VariablesGET /envs, PATCH /envs
Change domainDomainPATCH /domain
Stop or resumeLifecyclePATCH /stop, PATCH /resume
Scale instancesInstancesGET /instances, PATCH /instances
View previous deploysDeploymentsGET /historic/deployments
Observe metrics and logsMetrics and LogsGET /metrics, GET /logs
Investigate HTTP trafficNetwork MetricsGET /metrics/network/*
Change planPlanPATCH /plan
Manage storageStoragePATCH /storage/size, GET /storage/usage

HTTP Status Codes

CodeDescription
200Request successful
400Invalid or malformed data
401Invalid or missing API Key
402Current plan does not allow the requested feature
403Organization or permission is insufficient
404Project not found
409Operation not allowed in the current project state
500Internal 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.