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/stopPath 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 |
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
| Status | Code | When it happens |
|---|---|---|
404 | — | Project not found |
409 | PROJECT_OPERATION_IN_PROGRESS | Another operation is in progress for the project, such as another stop, a resume, a plan change, a storage change, or a credential rotation |
409 | PROJECT_STATE_CONFLICT | The 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/resumeResuming 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
| Parameter | Type | Description |
|---|---|---|
id | string | Project ID |
Response
{
"status": "success",
"message": "project resume accepted"
}Errors
| Status | Code | When it happens |
|---|---|---|
402 | ORGANIZATION_BILLING_BLOCKED | The organization is blocked due to pending payments |
404 | — | Project not found |
409 | PROJECT_STATE_CONFLICT | The project is not stopped (for example, it is already running) |
409 | PROJECT_OPERATION_IN_PROGRESS | The resume or another operation is already in progress for the project |
409 | INSUFFICIENT_PLAN_CAPACITY | The requested capacity is unavailable on the plan |
409 | FREE_PLAN_INSTANCE_LIMIT_REACHED | The legacy Free plan instance limit was reached |
503 | PLAN_CAPACITY_TEMPORARILY_UNAVAILABLE | Project 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"
}| Status | code | message | What to do |
|---|---|---|---|
409 | PROJECT_OPERATION_IN_PROGRESS | Another operation is in progress for this project | Wait for the current operation to finish and try again |
409 | PROJECT_STATE_CONFLICT | This operation is not available while the project is in its current state | Check status in GET /v1/project/:id; for example, resume the project before changing instances |
402 | ORGANIZATION_BILLING_BLOCKED | This organization has pending payments | Pay the outstanding amounts in Manage payments |
422 | PROJECT_OPERATION_NOT_SUPPORTED | This operation is not available for this project type | The 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
Project information
List and filter projects by type, status, and Valkey profile, read details and image failures, and update name, description, and exposure via the Zenifra API.
Project Plan
Change your project's plan through the Zenifra API, with the rules for each project type and the errors, and turn automatic renewal of contracts on or off.