space.schedule.delete()

Delete a job and all its runs.

Deletes a job and all its runs. This cannot be undone.

delete(id: string, options?: CallOptions): Promise<void>

Parameters

idstringRequired

The job’s ID: 26 lowercase letters and digits.

options.signalAbortSignal

Cancels the call.

options.timeoutMsnumber

How long the call may take, in milliseconds. The timeoutMs set in createSpace when you leave it out, 30,000 by default.

Returns

A promise that settles with nothing once the job is deleted. To stop a job for a while and keep its history, pause it instead.

The call is sent again, up to retries times, when it fails in a way that may pass, such as a network failure or 503. A job deleted by an earlier try then gives not_found.

Errors

CodeWhen
validation_failedid is not a job ID
not_foundThe project has no job with that ID

Every call can also fail with the codes shared by all of space, such as missing_project or network_error. See SpaceError.

Example

delete-job.ts
import { space, SpaceError } from "digitospace"

try {
  await space.schedule.delete("01m3c081d2wj4g63qcr53pa1yh")
} catch (error) {
  if (!(error instanceof SpaceError && error.code === "not_found")) throw error
}

Last updated