← Back to index Logout

title: Job Management API version: 1.0 date: 2026-10-25 author: Core Team status: Active


Job Management

Control job execution with pause/resume functionality. Useful for managing system load and prioritizing jobs.

POST /api/v1/jobs/:uuid/pause

Auth: Required Scope: job-level

Pause a running or pending job. The worker will skip this job during polling until resumed.

Path Parameters

Parameter Type Description
uuid string Job UUID (file_uuid)

Example

curl -X POST "$API/api/v1/jobs/$JOB_UUID/pause" -H "X-API-Key: $KEY"

Response (200)

{
  "success": true,
  "message": "Job 3a6c1865... paused",
  "uuid": "3a6c1865..."
}

Error Responses

HTTP When
404 Job not found
400 Job already completed or failed
401 Missing or invalid API key

Note: Cannot pause jobs with status completed or failed.


POST /api/v1/jobs/:uuid/resume

Auth: Required Scope: job-level

Resume a paused job. The job will be picked up by the worker in the next polling cycle.

Path Parameters

Parameter Type Description
uuid string Job UUID (file_uuid)

Example

curl -X POST "$API/api/v1/jobs/$JOB_UUID/resume" -H "X-API-Key: $KEY"

Response (200)

{
  "success": true,
  "message": "Job 3a6c1865... resumed",
  "uuid": "3a6c1865..."
}

Error Responses

HTTP When
404 Job not found
401 Missing or invalid API key

GET /api/v1/jobs/paused

Auth: Required Scope: user-level

List all currently paused jobs with file names and pause timestamps.

Example

curl -s "$API/api/v1/jobs/paused" -H "X-API-Key: $KEY"

Response (200)

{
  "jobs": [
    {
      "uuid": "3a6c1865...",
      "file_name": "video1.mp4",
      "status": "paused",
      "paused_at": "2026-10-25T10:30:00Z"
    },
    {
      "uuid": "4b7d2976...",
      "file_name": "video2.mp4",
      "status": "paused",
      "paused_at": "2026-10-25T11:15:00Z"
    }
  ],
  "total": 2
}
Field Type Description
jobs array Array of paused job objects
uuid string Job UUID (file_uuid)
file_name string Original file name
status string Always "paused"
paused_at string | null ISO 8601 timestamp when paused
total integer Total number of paused jobs

GET /api/v1/jobs/:uuid/status

Auth: Required Scope: job-level

Get the current status of a specific job. Returns detailed status including processor progress.

Path Parameters

Parameter Type Description
uuid string Job UUID (file_uuid)

Example

curl -s "$API/api/v1/jobs/$JOB_UUID/status" -H "X-API-Key: $KEY"

Response (200)

{
  "uuid": "3a6c1865...",
  "status": "paused",
  "current_processor": "face",
  "progress_current": 1500,
  "progress_total": 2892,
  "created_at": "2026-10-25T09:00:00Z",
  "started_at": "2026-10-25T09:05:00Z",
  "paused_at": "2026-10-25T10:30:00Z"
}
Field Type Description
uuid string Job UUID
status string Current status (pending, running, paused, completed, failed)
current_processor string | null Currently running processor
progress_current integer Current progress value
progress_total integer Total progress units
created_at string Job creation timestamp
started_at string | null Job start timestamp
paused_at string | null Pause timestamp (if paused)

POST /api/v1/admin/sync-status

Auth: Required Scope: admin-level

Synchronize job statuses between database and Redis. Used for maintenance and consistency checks.

Example

curl -X POST "$API/api/v1/admin/sync-status" -H "X-API-Key: $KEY"

Response (200)

{
  "success": true,
  "message": "Status sync completed",
  "synced_count": 15
}

Job Status Lifecycle

pending → running → completed
    ↓        ↓
  paused   failed
    ↓
 pending (resumed)
Status Description Actions Available
pending Waiting in queue Pause
running Currently processing Pause
paused Paused by user Resume
completed Finished successfully None
failed Error occurred None

Use Cases

1. Pause Heavy Processing Job

# Pause a running job to free up resources
curl -X POST "$API/api/v1/jobs/$UUID/pause" -H "X-API-Key: $KEY"

2. Resume Previously Paused Job

# Resume a paused job
curl -X POST "$API/api/v1/jobs/$UUID/resume" -H "X-API-Key: $KEY"

3. List All Paused Jobs

# Get all paused jobs
curl -s "$API/api/v1/jobs/paused" -H "X-API-Key: $KEY" | jq '.jobs[]'

4. Check Job Status

# Check if a job is paused or running
curl -s "$API/api/v1/jobs/$UUID/status" -H "X-API-Key: $KEY" | jq '.status'

Implementation Notes


Version History

Version Date Changes
1.0 2026-10-25 Initial documentation