API endpoint that allows jobs to be viewed or edited.

Pass the start_now url parameter to the POST method to enqueue the job immediately.

Use the delay field to create a test job with fake duration of work (in seconds).

Actions

/jobs/{id}/run/ (POST)

Run a job (add it to the queue).

/jobs/{id}/cancel/ (POST)

Cancel a job (terminate the background task)

GET /api/v2/jobs/124/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 124,
    "details": "https://api.beluga.insectai.org/api/v2/jobs/124/?format=api",
    "name": "Trest",
    "delay": 10,
    "limit": 100,
    "shuffle": true,
    "project": {
        "id": 16,
        "name": "Aarhus Universitet, Department of Ecoscience",
        "details": "https://api.beluga.insectai.org/api/v2/projects/16/?format=api",
        "user_permissions": []
    },
    "deployment": null,
    "source_image_collection": {
        "id": 5,
        "name": "Denmark with detections",
        "details": "https://api.beluga.insectai.org/api/v2/captures/collections/5/?format=api",
        "method": "detections_only",
        "user_permissions": []
    },
    "source_image_single": null,
    "pipeline": {
        "id": 1,
        "details": "https://api.beluga.insectai.org/api/v2/ml/pipelines/1/?format=api",
        "name": "Panama moths",
        "slug": "panama_moths_2023",
        "description": "",
        "version": 1,
        "version_name": "",
        "created_at": "2023-11-10T02:41:27.683282",
        "updated_at": "2026-04-01T17:09:36.425601",
        "user_permissions": []
    },
    "status": "SUCCESS",
    "created_at": "2023-11-20T14:59:14.826005",
    "updated_at": "2024-11-13T17:15:35.468054",
    "started_at": "2023-11-20T14:59:17.527901",
    "finished_at": "2023-11-20T14:59:27.852314",
    "duration": "10.324413",
    "progress": {
        "summary": {
            "status": "SUCCESS",
            "progress": 1.0
        },
        "stages": [
            {
                "status": "SUCCESS",
                "progress": 1.0,
                "key": "delay",
                "name": "Delay",
                "params": [
                    {
                        "name": "Delay",
                        "key": "delay",
                        "category": "default",
                        "value": 30
                    },
                    {
                        "name": "Mood",
                        "key": "mood",
                        "category": "default",
                        "value": "🥳"
                    }
                ]
            }
        ],
        "errors": [],
        "logs": [
            "[2023-11-20 14:59:27] INFO Finished job #124 \"Trest\" (SUCCESS)",
            "[2023-11-20 14:59:27] INFO Changing status of job 124 to SUCCESS",
            "[2023-11-20 14:59:27] INFO Delaying job 124 for the 9 out of 10 seconds",
            "[2023-11-20 14:59:25] INFO Delaying job 124 for the 7 out of 10 seconds",
            "[2023-11-20 14:59:23] INFO Delaying job 124 for the 5 out of 10 seconds",
            "[2023-11-20 14:59:21] INFO Delaying job 124 for the 3 out of 10 seconds",
            "[2023-11-20 14:59:19] INFO Delaying job 124 for the 1 out of 10 seconds",
            "[2023-11-20 14:59:17] INFO Changing status of job 124 to STARTED",
            "[2023-11-20 14:59:17] INFO Running job #124 \"Trest\" (PENDING)",
            "[2023-11-20 14:59:17] INFO Changing status of job 124 to PENDING"
        ]
    },
    "logs": {
        "stdout": [
            "[2023-11-20 14:59:27] INFO Finished job #124 \"Trest\" (SUCCESS)",
            "[2023-11-20 14:59:27] INFO Changing status of job 124 to SUCCESS",
            "[2023-11-20 14:59:27] INFO Delaying job 124 for the 9 out of 10 seconds",
            "[2023-11-20 14:59:25] INFO Delaying job 124 for the 7 out of 10 seconds",
            "[2023-11-20 14:59:23] INFO Delaying job 124 for the 5 out of 10 seconds",
            "[2023-11-20 14:59:21] INFO Delaying job 124 for the 3 out of 10 seconds",
            "[2023-11-20 14:59:19] INFO Delaying job 124 for the 1 out of 10 seconds",
            "[2023-11-20 14:59:17] INFO Changing status of job 124 to STARTED",
            "[2023-11-20 14:59:17] INFO Running job #124 \"Trest\" (PENDING)",
            "[2023-11-20 14:59:17] INFO Changing status of job 124 to PENDING"
        ],
        "stderr": []
    },
    "job_type": {
        "name": "ML pipeline",
        "key": "ml"
    },
    "data_export": null,
    "dispatch_mode": "internal",
    "result": null,
    "user_permissions": []
}