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/1256/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 1256,
    "details": "https://api.beluga.insectai.org/api/v2/jobs/1256/?format=api",
    "name": "Populate captures for collection 111",
    "delay": 0,
    "limit": null,
    "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": 111,
        "name": "Random 1000",
        "details": "https://api.beluga.insectai.org/api/v2/captures/collections/111/?format=api",
        "method": "random",
        "user_permissions": []
    },
    "source_image_single": null,
    "pipeline": null,
    "status": "SUCCESS",
    "created_at": "2025-11-12T19:00:59.806356",
    "updated_at": "2025-11-12T19:01:00.384337",
    "started_at": "2025-11-12T19:00:59.987715",
    "finished_at": "2025-11-12T19:01:00.343918",
    "duration": "0.356203",
    "progress": {
        "summary": {
            "status": "SUCCESS",
            "progress": 1.0
        },
        "stages": [
            {
                "status": "SUCCESS",
                "progress": 1.0,
                "key": "populate_captures_collection",
                "name": "Populate captures collection",
                "params": [
                    {
                        "name": "Captures added",
                        "key": "captures_added",
                        "category": "default",
                        "value": 1000
                    }
                ]
            }
        ],
        "errors": [],
        "logs": []
    },
    "logs": {
        "stdout": [
            "[2025-11-12 19:01:00] INFO Finished job #1256 \"Populate captures for collection 111\" (SUCCESS)",
            "[2025-11-12 19:01:00] INFO Changing status of job 1256 from STARTED to SUCCESS",
            "[2025-11-12 19:01:00] INFO Added 1000 captures to source image collection #111 Random 1000",
            "[2025-11-12 19:01:00] INFO Finished populating source image collection #111 Random 1000",
            "[2025-11-12 19:01:00] INFO Done sampling and saving captures to #111 Random 1000",
            "[2025-11-12 19:01:00] INFO Sampling and saving captures to #111 Random 1000",
            "[2025-11-12 19:00:59] INFO Sampling using method 'sample_random' with params: {'size': 1000, 'event_ids': None, 'deployment_ids': None}",
            "[2025-11-12 19:00:59] INFO Populating source image collection #111 Random 1000",
            "[2025-11-12 19:00:59] INFO Changing status of job 1256 from PENDING to STARTED",
            "[2025-11-12 19:00:59] INFO Running job #1256 \"Populate captures for collection 111\" (PENDING)"
        ],
        "stderr": []
    },
    "job_type": {
        "name": "Populate captures collection",
        "key": "populate_captures_collection"
    },
    "data_export": null,
    "dispatch_mode": "internal",
    "result": null,
    "user_permissions": []
}