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:

ValueWhere to use itDescription
Token or API KeyAuthorization or the accepted authentication headerSession or organization credential
Organization IDx-organization-id headerActive organization where the project exists
Project ID:id path parameterProject 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:

TaskMinimum scope
Create an HTTP projectproject.create on organization:*
Create a databasedatabase.create on organization:*
Create Cache, Queue, or Valkeymanaged_service.create on organization:*
Read a projectproject.read on project:<project-id>
Metrics and storage usageproject.metrics.read on project:<project-id>
Logs and buildsproject.logs.read on project:<project-id>

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

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

HeaderRequiredWhen to useDescription
x-api-key or equivalent credentialRoute-dependentAll protected callsOrganization API Key or legacy project credential, when documented
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 and change project exposureProject InformationGET /project/:id, PATCH /name, PATCH /description, PATCH /project/:id/exposure
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
Follow GitHub buildsGitHub BuildsPOST /github/deploy, GET /github/builds, GET /github/builds/:buildId/logs
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.

On this page