Skip to Content

Stop Project

Pauses the project execution.

Required permissions

Stopping a project requires project.stop on project:<project-id>. Resuming requires project.resume on the same project. owner has full access; assistant, member, and organization API Keys need the scope for the action.

PATCH /v1/project/:id/stop

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

Response

{
  "status": "success",
  "message": "stopped project with success"
}

Only a running project (running) can be stopped. When it stops:

  • the application goes to 0 instances and is no longer reachable;
  • with hourly billing, compute billing is closed at the moment of the stop and there is no compute charge while the project is stopped; persistent storage is still billed;
  • with monthly and yearly contracts, stopping does not change the contract amount;
  • Zenifra keeps the number of instances the project had, which is used on resume.

Errors

StatusCodeWhen it happens
404—Project not found
409PROJECT_OPERATION_IN_PROGRESSAnother operation is in progress for the project, such as another stop, a resume, a plan change, a storage change, or a credential rotation
409PROJECT_STATE_CONFLICTThe project is not running (for example, it is already stopped)

Rate limit: 30 requests per minute (counted per source IP).


Resume Project

Resumes execution of a stopped project.

PATCH /v1/project/:id/resume

Resuming is asynchronous: the API accepts the request and the project moves to the resuming status until it returns to running. Query GET /v1/project/:id to follow progress.

Only a stopped project (stopped) can be resumed. It comes back with the number of instances it had when it was stopped. HTTP applications with auto-scaling come back with the configured minimum, and Analytics databases and Valkey services come back with the instances defined by the plan. With hourly billing, compute billing starts again on resume.

Path Parameters

ParameterTypeDescription
idstringProject ID

Response

{
  "status": "success",
  "message": "project resume accepted"
}

Errors

StatusCodeWhen it happens
402ORGANIZATION_BILLING_BLOCKEDThe organization is blocked due to pending payments
404—Project not found
409PROJECT_STATE_CONFLICTThe project is not stopped (for example, it is already running)
409PROJECT_OPERATION_IN_PROGRESSThe resume or another operation is already in progress for the project
409INSUFFICIENT_PLAN_CAPACITYThe requested capacity is unavailable on the plan
409FREE_PLAN_INSTANCE_LIMIT_REACHEDThe legacy Free plan instance limit was reached
503PLAN_CAPACITY_TEMPORARILY_UNAVAILABLEProject capacity is temporarily unavailable; try again shortly

Rate limit: 30 requests per minute (counted per source IP).


Conflicts and billing block

Operations that change the project state or billing (stop, resume, delete, plan change, instance change, and storage change) run one at a time per project. When the operation cannot run, the API rejects the request before any change or charge, with a standard body:

{
  "status": "failed",
  "code": "PROJECT_OPERATION_IN_PROGRESS",
  "message": "Another operation is in progress for this project"
}
StatuscodemessageWhat to do
409PROJECT_OPERATION_IN_PROGRESSAnother operation is in progress for this projectWait for the current operation to finish and try again
409PROJECT_STATE_CONFLICTThis operation is not available while the project is in its current stateCheck status in GET /v1/project/:id; for example, resume the project before changing instances
402ORGANIZATION_BILLING_BLOCKEDThis organization has pending paymentsPay the outstanding amounts in Manage payments
422PROJECT_OPERATION_NOT_SUPPORTEDThis operation is not available for this project typeThe operation does not exist for this project type

An organization blocked due to pending payments cannot increase spending: creating projects, resuming, moving to a larger plan, adding instances, and increasing storage return 402. Stopping, deleting, reducing instances, and moving to a smaller plan remain available.

Retrying a stop or a delete after a network failure does not charge twice: the billed period is closed only once.


Examples

Stop Project

curl -X PATCH "https://api.zenifra.com/v1/project/507f1f77bcf86cd799439011/stop" \
  -H "x-api-key: your-api-key" \
  -H "x-organization-id: your-organization-id"

Resume Project

curl -X PATCH "https://api.zenifra.com/v1/project/507f1f77bcf86cd799439011/resume" \
  -H "x-api-key: your-api-key" \
  -H "x-organization-id: your-organization-id"

Python

import requests

API_KEY = "your-api-key"
ORGANIZATION_ID = "your-organization-id"
PROJECT_ID = "507f1f77bcf86cd799439011"

headers = {"x-api-key": API_KEY, "x-organization-id": ORGANIZATION_ID}

# Stop project
stop_response = requests.patch(
    f"https://api.zenifra.com/v1/project/{PROJECT_ID}/stop",
    headers=headers
).json()
print(stop_response)

# Resume project
resume_response = requests.patch(
    f"https://api.zenifra.com/v1/project/{PROJECT_ID}/resume",
    headers=headers
).json()
print(resume_response)

Use Cases

  • Maintenance: Pause the project during scheduled maintenance
  • Cost savings: Pause projects that don't need to run continuously
  • Testing: Pause test environments when not in use

Last updated on

On this page