---
title: "Get worker daemon status"
method: GET
path: "/jobs/worker_status"
tags: ["Jobs"]
---

# Get worker daemon status

`GET /jobs/worker_status`

## Request

- Base URL: `https://localhost/index.php/api`
- URL: `https://localhost/index.php/api/jobs/worker_status`
- Auth: API key in header `X-API-Key`
- TypeScript: <https://skmtc.dev/worldbank/apis/metadata-editor-jobs-api/docs/jobs/worker_status/get.ts> (a function with typed inputs; its response is checked against the schema)

Check if the background job worker daemon is running by checking PID and heartbeat files

## Response `200`

successful operation

- WorkerStatusResponse
  - `status` string
  - `worker` WorkerStatus
    - `is_running` boolean: Whether the worker process is running
    - `is_alive` boolean: Whether the worker is alive (based on heartbeat)
    - `pid_file_exists` boolean: Whether PID file exists
    - `heartbeat_file_exists` boolean: Whether heartbeat file exists
    - `heartbeat_age_seconds` integer: Age of last heartbeat in seconds
    - `pid_data` object: PID file data
      - `pid` integer
      - `worker_id` string
      - `started_at` string
      - `poll_interval` integer
    - `heartbeat_data` object: Heartbeat file data
      - `worker_id` string
      - `pid` integer
      - `timestamp` integer
      - `datetime` string
    - `active_worker_count` integer: Number of active workers (jobs currently being processed)
    - `active_worker_ids` string[]: List of active worker IDs

## Other responses

- `400`: Bad request

---

[API](https://skmtc.dev/worldbank/apis/metadata-editor-jobs-api.md) - [All operations](https://skmtc.dev/worldbank/apis/metadata-editor-jobs-api/llms.txt) - [OpenAPI document](https://skmtc.dev/worldbank/apis/metadata-editor-jobs-api/revisions/755536b6492e?raw)
