listJobRuns()
Signature
client.listJobRuns(
id: string,
params?: { limit?: number; offset?: number }
): Promise<JobRunListResponse>Parameters#
| Param | Type | Default | Description |
|---|---|---|---|
id | string | — | UUID of the job |
params.limit | number | 20 | Max runs to return (1–100) |
params.offset | number | 0 | Pagination offset |
Usage#
ts
import { VeloraClient } from '@rimora/velora'
import fetch from 'node-fetch'
const client = new VeloraClient({
apiKey: process.env.VELORA_API_KEY,
fetch: fetch as any
})
const jobId = '9f4a1c2b-3d4e-5f6a-7b8c-9d0e1f2a3b4c'
// Latest 10 runs
const { runs, total } = await client.listJobRuns(jobId, { limit: 10 })
for (const run of runs) {
const status = run.status === 'success' ? '✓' : '✗'
console.log(`${status} ${run.started_at} → ${run.status_code} (${run.duration_ms}ms)`)
}
console.log(`Showing ${runs.length} of ${total} total runs`)
// Fetch failed runs using pagination
let offset = 0
const failedRuns = []
while (true) {
const page = await client.listJobRuns(jobId, { limit: 50, offset })
failedRuns.push(...page.runs.filter(r => r.status === 'failed'))
if (offset + 50 >= page.total) break
offset += 50
}Response#
JobRunListResponse
{
"runs": [
{
"id": "run_abc123",
"job_id": "9f4a1c2b-3d4e-5f6a-7b8c-9d0e1f2a3b4c",
"status": "success",
"status_code": 200,
"duration_ms": 312,
"started_at": "2026-04-07T09:00:00.000Z",
"completed_at": "2026-04-07T09:00:00.312Z",
"error": null
}
],
"total": 48,
"limit": 10,
"offset": 0
}Run status values#
| status | Meaning |
|---|---|
success | HTTP 2xx received from target |
failed | Non-2xx response or network error |
timeout | Request exceeded timeout_ms |
running | Execution is in progress |
Required scope#
Requires: jobs:read (or admin, *)
Common errors#
| Status | error | Cause |
|---|---|---|
401 | invalid_api_key | Missing or revoked API key |
403 | insufficient_scope | Key lacks jobs:read scope |
404 | not_found | Job does not exist |