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"
}

Errors

StatusWhen it happens
404Project not found
409A 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/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.

Path Parameters

ParameterTypeDescription
idstringProject ID

Response

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

Errors

StatusWhen it happens
400The project is already running
402The organization is blocked due to unpaid billing
404Project not found
409The 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)
503Project 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

On this page