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"
}Errors
| Status | When it happens |
|---|---|
404 | Project not found |
409 | A stop is already in progress for the project |
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.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Project ID |
Response
{
"status": "success",
"message": "project resume accepted"
}Errors
| Status | When it happens |
|---|---|
400 | The project is already running |
402 | The organization is blocked due to unpaid billing |
404 | Project not found |
409 | The resume is already in progress, the requested capacity is temporarily unavailable (INSUFFICIENT_PLAN_CAPACITY), or the Free plan instance limit was reached (FREE_PLAN_INSTANCE_LIMIT_REACHED) |
503 | Project capacity is temporarily unavailable (PLAN_CAPACITY_TEMPORARILY_UNAVAILABLE); try again shortly |
Rate limit: 30 requests per minute (counted per source IP).
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