deleteJob()
Signature
client.deleteJob(id: string): Promise<SimpleResponse>Parameters#
| Param | Type | Description |
|---|---|---|
id | string | UUID of the job to delete |
Usage#
ts
import { VeloraClient, VeloraError } 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'
try {
const result = await client.deleteJob(jobId)
console.log(result.msg) // "Job deleted"
} catch (err) {
if (err instanceof VeloraError) {
if (err.status === 404) {
console.log('Job not found — already deleted?')
} else {
throw err
}
}
}Deletion is permanent. Once deleted, the job and all its run history cannot be recovered. For a reversible way to stop a job from running, use pauseJob() instead.
Response#
SimpleResponse
{
"id": "9f4a1c2b-3d4e-5f6a-7b8c-9d0e1f2a3b4c",
"msg": "Job deleted"
}Required scope#
Requires: jobs:delete or jobs:write (or admin, *)
Common errors#
| Status | error | Cause |
|---|---|---|
401 | invalid_api_key | Missing or revoked API key |
403 | insufficient_scope | Key lacks jobs:delete scope |
404 | not_found | Job does not exist |