Skip to main content
Jobs are the scheduled tasks InfraAudit uses to run drift detection, vulnerability scans, compliance assessments, and billing syncs. The jobs endpoints let you inspect scheduled jobs, trigger them manually, and view execution history. Base path: /api/v1/jobs

GET /jobs — list jobs

Returns all configured jobs with their schedules and last execution status.
GET /api/v1/jobs
Authorization: Bearer <token>

Response

[
  {
    "id": 1,
    "type": "drift_detection",
    "schedule": "0 */4 * * *",
    "enabled": true,
    "last_execution_status": "succeeded",
    "last_run_at": "2024-01-15T08:00:00Z",
    "next_run_at": "2024-01-15T12:00:00Z"
  }
]
type
string
Job type: drift_detection, vulnerability_scan, compliance_assess, or billing_sync.
schedule
string
Cron expression for the job’s schedule.

GET /jobs/ — get job

Returns details for a single job.
GET /api/v1/jobs/{id}
Authorization: Bearer <token>

POST /jobs//trigger — trigger manual run

Runs the job immediately regardless of its schedule. Returns 202 Accepted with an execution ID.
POST /api/v1/jobs/{id}/trigger
Authorization: Bearer <token>

Response 202

{
  "execution_id": 88,
  "status": "running",
  "started_at": "2024-01-15T10:30:00Z"
}

GET /jobs//executions — list execution history

Returns past executions for a job.
GET /api/v1/jobs/{id}/executions
Authorization: Bearer <token>

Query parameters

status
string
Filter by execution status: running, succeeded, or failed.
page
integer
default:"1"
Page number.
per_page
integer
default:"20"
Results per page.

Response

{
  "data": [
    {
      "id": 88,
      "job_id": 1,
      "status": "succeeded",
      "started_at": "2024-01-15T08:00:00Z",
      "ended_at": "2024-01-15T08:03:42Z",
      "duration_ms": 222000,
      "findings_count": 3
    }
  ]
}
findings_count
integer
Number of new findings created during this execution (drifts, vulnerabilities, etc.).

GET /jobs//executions/ — get execution detail

Returns the full execution record including a log excerpt.
GET /api/v1/jobs/{id}/executions/{execution_id}
Authorization: Bearer <token>