Create a job
Create a job that runs a Python script on the platform.
The code becomes the job’s script; declare its dependencies inline in a
PEP 723 # /// script block. The job then appears on the platform, where
it can be run and its executions reviewed. To change an existing job’s
name, description, or code, use update_job instead.
Requires an API key with the write scope.
Authentication
Bearer authentication of the form Bearer <token>, where token is your auth token.
Request
Python source of the script the job runs. Declare dependencies inline in a PEP 723 # /// script block.
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.
Restricts a file_uploaded trigger to files from this instrument.
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
Pass this as job_id to the job execution tools.
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.