createJob()

Signature
client.createJob(payload: JobCreatePayload): Promise<CreateJobResponse>

Payload#

FieldTypeRequiredDescription
target_urlstringYesAbsolute HTTPS URL the job will call on schedule
schedule_cronstringYes5-field cron expression (e.g. /5 *) or 6-field with year
namestringNoFriendly name for the job
descriptionstringNoOptional description
methodstringNoHTTP method. Defaults to POST
timezonestringNoIANA timezone. Defaults to UTC
folder_pathstringNoVirtual folder path for organization (e.g. /reports/, /checkin/monday/). Defaults to /
headers_jsonobjectNoCustom headers sent with each execution
body_jsonobjectNoJSON body sent with each execution
timeout_msnumberNoRequest timeout in milliseconds
retry_policy_jsonobjectNoRetry config — { max_retries: number, backoff_ms: number }

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
})

// Minimal — runs every 5 minutes
const simple = await client.createJob({
  target_url: 'https://yourapp.com/ping',
  schedule_cron: '*/5 * * * *'
})
console.log('Created:', simple.id)

// With folder organization
const foldered = await client.createJob({
  name: 'Daily report',
  target_url: 'https://yourapp.com/cron/daily-report',
  schedule_cron: '0 9 * * *',
  folder_path: '/reports/daily/'
})

// Full options
const full = await client.createJob({
  name: 'Weekly report',
  description: 'Sends weekly usage report every Monday at 9am UTC',
  target_url: 'https://yourapp.com/cron/weekly-report',
  method: 'POST',
  schedule_cron: '0 9 * * 1',
  timezone: 'UTC',
  folder_path: '/reports/weekly/',
  headers_json: { 'X-Secret': 'my-shared-secret' },
  body_json: { trigger: 'cron', version: 2 },
  timeout_ms: 10000,
  retry_policy_json: { max_retries: 3, backoff_ms: 5000 }
})
console.log('Created full job:', full.id)

Response#

CreateJobResponse
{
  "id": "9f4a1c2b-3d4e-5f6a-7b8c-9d0e1f2a3b4c",
  "owner_id": "a18eac82-fb19-4637-99b1-96ef5b8de6d4",
  "api_key_id": "95a3af0d-3a83-4b13-b819-cbf65d7c47bf",
  "status": "active",
  "msg": "Job created"
}

Required scope#

Requires: jobs:create (or jobs:write, admin, *)

Common errors#

StatuserrorCause
400validation_errorMissing target_url, invalid URL scheme, private/loopback target (SSRF block), missing schedule_cron, invalid cron, or past year
401invalid_api_keyMissing or revoked API key
403insufficient_scopeKey lacks jobs:create scope
403job_limit_exceededPlan job limit reached — delete unused jobs or upgrade
Velora blocks target_url values that resolve to private/loopback addresses (SSRF protection). Use a publicly reachable URL or a tunnelling service (e.g. ngrok) during local development.

© 2026 Velora · API Documentation