Update Deploy Image
Updates the Docker image of the project to initiate a new deploy.
Required permissions
The minimum scope is project.image.update on project:<project-id>. An owner user session has full access; assistant, member, and organization API Keys need this specific grant.
PATCH /v1/project/:id/imageApart from the preview environment routes with the opt-in enabled, this is the only route that still accepts the legacy project key. Rate limit: 10 requests per minute (counted per source IP).
The legacy key keeps working for whoever already uses it, but it is no longer returned by the API and new projects do not get one. For new automations, use an organization API Key with project.image.update.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Project ID |
Headers
| Header | Required | Description |
|---|---|---|
x-api-key or Authorization | Yes | Organization API Key or user token |
x-organization-id | With a user token | Active project organization. Not needed with an organization API key |
Content-Type: application/json | Yes | Required because the request has a JSON body |
Body
| Field | Type | Required | Description |
|---|---|---|---|
image | string | Yes | Docker image name with registry and tag (e.g., docker.io/library/nginx:1.27.3, myregistry.com/myapp:v1.0). Important: Always use a specific, immutable tag (like v1.0.0) instead of latest to avoid pulling different images unexpectedly. Length from 8 to 256 characters; references starting with http:// or https:// are rejected. |
Example
{
"image": "docker.io/library/nginx:1.27.3"
}Response
{
"status": "success",
"message": "updated with success"
}Errors
| Status | When it happens |
|---|---|
400 | image missing or in an invalid format |
400 | IMAGE_NOT_FOUND: the image or the tag does not exist; IMAGE_PULL_UNAUTHORIZED: the image is private and there is no valid credential, or the repository does not exist. See The application image could not be downloaded |
404 | Project not found |
409 | PROJECT_STATE_CONFLICT: the project does not have a published version to receive the new image yet |
422 | IMAGE_NOT_ALLOWED (message This image cannot be used): the image cannot be used in this project; use your own or a public image |
Examples
curl
curl -X PATCH "https://api.zenifra.com/v1/project/507f1f77bcf86cd799439011/image" \
-H "x-api-key: your-api-key" \
-H "x-organization-id: your-organization-id" \
-H "Content-Type: application/json" \
-d '{"image": "docker.io/library/nginx:1.27.3"}'Python
import requests
API_KEY = "your-api-key"
ORGANIZATION_ID = "your-organization-id"
PROJECT_ID = "507f1f77bcf86cd799439011"
response = requests.patch(
f"https://api.zenifra.com/v1/project/{PROJECT_ID}/image",
headers={"x-api-key": API_KEY, "x-organization-id": ORGANIZATION_ID},
json={"image": "docker.io/library/nginx:1.27.3"}
)
print(response.json())Node.js
const axios = require('axios');
const API_KEY = 'your-api-key';
const ORGANIZATION_ID = 'your-organization-id';
const PROJECT_ID = '507f1f77bcf86cd799439011';
axios.patch(
`https://api.zenifra.com/v1/project/${PROJECT_ID}/image`,
{ image: 'docker.io/library/nginx:1.27.3' },
{ headers: { 'x-api-key': API_KEY, 'x-organization-id': ORGANIZATION_ID } }
).then(res => console.log(res.data));Last updated on
Invite links API
Create single-use invite links valid for 24 hours via the Zenifra API, list and revoke active links, and accept one to create an organization-only account.
Deployment History
Query the monthly deployment history of a Zenifra project through the API with API Key authentication, the active organization, and the image update flag.