Updates the Docker image of the project to initiate a new deploy.
Parameter Type Description idstring Project ID (ObjectId)
Header Required Description x-api-keyYes Project API Key x-organization-idYes Active project organization Content-Type: application/jsonYes Required because the request has a JSON body
Field Type Required Description imagestring Yes Docker image name with registry and tag (e.g., docker.io/nginx:perl, 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.
{
"image" : "docker.io/nginx:perl"
}
{
"status" : "success" ,
"message" : "updated with success"
}
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/nginx:perl"}'
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/nginx:perl" }
)
print (response.json())
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/nginx:perl' },
{ headers: { 'x-api-key' : API_KEY , 'x-organization-id' : ORGANIZATION_ID } }
). then ( res => console. log (res.data));