Jobs

Update a job

Change a job's name, description, code, trigger, or parameters, or archive it.

Only the fields passed are changed. To change part of the script, pass edits: exact replacements of text in the current script. Pass code only to replace the whole script. New code is stored as a new version of the job's script, so earlier executions keep the version they ran. To create a job, use create_job instead.

Requires an API key with the write scope.

patch/api/v1/jobs/{job_id}

Request

  • Base URL: https://platform.labric.co
  • URL: https://platform.labric.co/api/v1/jobs/{job_id}
  • Auth: HTTP bearer

Path parameters

job_idstring required

Request body

namestring nullable

New name for the job.

descriptionstring nullable

New description for the job. Pass an empty string to clear it.

codestring nullable

Complete new Python source for the job's script, stored as a new script version. Declare dependencies inline in a PEP 723 # /// script block. For a change to part of the script, pass edits instead.

archivedboolean nullable

True archives the job, hiding it from the active job list; false restores it.

trigger_enabledboolean nullable

True creates or replaces the job's trigger from the trigger fields; false removes it.

trigger_category'file_uploaded' | 'job_completed' | 'schedule'
trigger_instrument_idstring uuid nullable

Restricts a file_uploaded trigger to files from this instrument.

trigger_conditionsobject nullable

Filters on the triggering event. For file_uploaded, any of file_name_pattern, file_extensions (list of strings starting with '.'; files with no extension always pass), source_type, min_size_kb, and max_size_kb (both inclusive). file_name_pattern is a case-sensitive glob in which * matches any characters, including folder separators, ? matches one character, and '/' and '' each match either separator. It must match the file's whole path or the part after any separator, so '.csv' and 'run_.csv' match files in any folder. For job_completed, source_job_id (required) and statuses (list drawn from completed and failed; defaults to completed). For schedule, cron (required five-field expression: minute, hour, day of month, month, day of week) and timezone (required IANA timezone, e.g. America/Los_Angeles). Cron supports numbers, month and weekday names, *, ranges, lists, and steps.

Response

OK

idstring uuid required

Pass this as job_id to the job execution tools.

namestring required
descriptionstring nullable
archivedboolean required

Changes

No recorded changes to this operation across all 1 revision of this API.