Logo ZenifraZenifra

Zenifra API

Complete documentation of the Zenifra REST API for project management via API Key.

Zenifra API

The Zenifra API allows you to manage your projects programmatically. All endpoints listed in this documentation use API Key authentication (header x-api-key).

Authentication

To use the API, you need to include the x-api-key header in all requests. The API Key can be found in your project settings in the console.

Required Header

HeaderDescription
x-api-keyYour project API Key

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"

Available Endpoints

Project Management

EndpointDescription
Update Deploy ImageUpdate the Docker image of the project
Metrics and LogsGet metrics and logs of the project
Project InformationUpdate name and description
Environment VariablesManage environment variables
DomainUpdate project subdomain
LifecycleStop and resume the project
PlanChange project plan
StorageManage storage

HTTP Status Codes

CodeDescription
200Request successful
400Invalid or malformed data
401Invalid or missing API Key
404Project not found
500Internal server error

Usage Examples

Python

import requests

API_KEY = "your-api-key"
BASE_URL = "https://api.zenifra.com/v1"

headers = {
    "x-api-key": API_KEY,
    "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 BASE_URL = 'https://api.zenifra.com/v1';

const headers = {
  'x-api-key': API_KEY,
  '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.

Do the endpoints have rate limiting?

Yes, the API has rate limiting to ensure stability. If you exceed the limit, you will receive 429 (Too Many Requests) errors.