updateJob()
Signature
client.updateJob(id: string, payload: JobUpdatePayload, includeHttpDetails?: boolean): Promise<Job>Parameters#
| Param | Type | Description |
|---|---|---|
id | string | UUID of the job to update |
payload | JobUpdatePayload | Partial job fields to update (all optional) |
includeHttpDetails | boolean (optional) | Include HTTP headers and body from latest job run |
JobUpdatePayload fields#
| Field | Type | Description |
|---|---|---|
name | string | Human-readable name |
folder_path | string | Virtual folder path for organization (e.g. /reports/, /checkin/monday/) |
schedule_type | "cron" | "interval" | Scheduling mode |
schedule_cron | string | Cron expression (when schedule_type is cron) |
schedule_interval_seconds | number | Interval in seconds (when schedule_type is interval) |
timezone | string | IANA timezone name |
target_url | string | Destination URL to call |
method | string | HTTP method (GET, POST, PUT, PATCH, DELETE) |
headers | Record<string, string> | Custom request headers |
payload | string | Raw request body string |
timeout_ms | number | Request timeout in milliseconds |
max_retries | number | Max retry attempts on failure |
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'
// Update the schedule and timeout
const result = await client.updateJob(jobId, {
schedule_cron: '0 10 * * 1-5',
timezone: 'Europe/London',
timeout_ms: 60000
})
console.log(result.msg) // "Job updated"
// Move job to a different folder
await client.updateJob(jobId, {
folder_path: '/reports/weekly/'
})
// Update the payload body
await client.updateJob(jobId, {
payload: JSON.stringify({ env: 'production', users: true })
})Response#
Job
{
"id": "9f4a1c2b-3d4e-5f6a-7b8c-9d0e1f2a3b4c",
"name": "Daily digest",
"status": "active",
"schedule_cron": "0 9 * * 1-5",
"next_run_at": "2026-04-07T09:00:00.000Z",
"webhook_signature_enabled": true
}The
webhook_signature_enabled field is always included in job responses. It is set to true when the job has a webhook_secret configured, indicating that Velora will sign outgoing requests with the X-Hub-Signature-256 header.When includeHttpDetails=true, the response will include an http_details field with headers, body, status_code, and timestamp from the latest job run.
Updating
schedule_cron, schedule_interval_seconds, or timezone will cause Velora to recalculate next_run_at based on the new schedule.Required scope#
Requires: jobs:update or jobs:write (or admin, *)
Common errors#
| Status | error | Cause |
|---|---|---|
400 | invalid_schedule | The provided cron expression is malformed |
401 | invalid_api_key | Missing or revoked API key |
403 | insufficient_scope | Key lacks jobs:update scope |
404 | not_found | Job does not exist |