Skip to navigation

Update a job

View as Markdown

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.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

job_idstringRequired

Request

This endpoint expects an object.
namestring or nullOptional1-200 characters
New name for the job.
descriptionstring or nullOptional
New description for the job. Pass an empty string to clear it.
codestring or nullOptional

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.

editslist of objects or nullOptional

Replacements applied in order to the job’s current script, stored as a new script version. Each old_string is matched against the script as left by the edits before it. If any edit fails to match, no change is saved. Cannot be combined with code.

archivedboolean or nullOptional

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

trigger_enabledboolean or nullOptional

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

trigger_categoryenum or nullOptional

What runs the job automatically: file_uploaded runs it on each uploaded file that matches the conditions; job_completed runs it on the output files of another job’s executions; schedule configures a recurring cron schedule. Required when trigger_enabled is true.

Allowed values:
trigger_instrument_idstring or nullOptionalformat: "uuid"

Restricts a file_uploaded trigger to files from this instrument.

trigger_conditionsmap from strings to any or nullOptional

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.

parameter_definitionslist of objects or nullOptional
Inputs the script reads at run time. Each is rendered as a form control when the job is run on the platform.
publish_statusenumOptional

draft while the job is still being worked on; in_review once its author considers it ready for an admin to publish; published once it is ready for others to rely on. New jobs start as draft.

Allowed values:

Response

OK
idstringformat: "uuid"

Pass this as job_id to the job execution tools.

namestring
archivedboolean
publish_statusenum

draft while the job is still being worked on; in_review once its author considers it ready for an admin to publish; published once it is ready for others to rely on. New jobs start as draft.

Allowed values:
descriptionstring or nullOptional
triggerobject or nullOptional
parameter_definitionslist of objects or nullOptional

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
422
Unprocessable Entity Error
500
Internal Server Error