Skip to Content

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/image

Apart 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

ParameterTypeDescription
idstringProject ID

Headers

HeaderRequiredDescription
x-api-key or AuthorizationYesOrganization API Key or user token
x-organization-idWith a user tokenActive project organization. Not needed with an organization API key
Content-Type: application/jsonYesRequired because the request has a JSON body

Body

FieldTypeRequiredDescription
imagestringYesDocker 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

StatusWhen it happens
400image missing or in an invalid format
400IMAGE_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
404Project not found
409PROJECT_STATE_CONFLICT: the project does not have a published version to receive the new image yet
422IMAGE_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

On this page