Problem
You want to fetch the CREATE job JSON from the Jobs UI tab using an API call instead.
Cause
There is no dedicated API endpoint to retrieve the original CREATE job JSON. However, the settings field in the /api/2.1/jobs/get
API contains all the necessary fields to reconstruct it.
Solution
Use the following example code to construct a GET job JSON file using the /api/2.1/jobs/get
endpoint. The GET job includes the fields from a CREATE job as well as a “created_time”
key.
{
"job_id": <job-id>,
"creator_user_name": "<user-email>",
"run_as_user_name": "<user-email>",
"run_as_owner": true,
"settings": {
"name": "<your-job-name>",
"email_notifications": {},
"webhook_notifications": {},
"max_concurrent_runs": 1,
"tasks": [
{
"task_key": "<your_job_name_with_underscores>",
"run_if": "ALL_SUCCESS",
"notebook_task": {
"notebook_path": "/Users/<user-email>/<your-job>",
"source": "WORKSPACE"
},
"existing_cluster_id": "<cluster-id>",
"timeout_seconds": 0
}
],
"format": "MULTI_TASK"
},
"created_time": 1742198198666
}
Additional information
To compare outputs, the following code is a CREATE job JSON for the same job. Only the “created_time”
key is not included.
{
"name": "<your-job-name>",
"email_notifications": {},
"webhook_notifications": {},
"max_concurrent_runs": 1,
"tasks": [
{
"task_key": "<your_job_name_with_underscores>",
"run_if": "ALL_SUCCESS",
"notebook_task": {
"notebook_path": "/Users/<user-email>/<your-job>",
"source": "WORKSPACE"
},
"existing_cluster_id": <cluster-id>,
"timeout_seconds": 0
}
],
"run_as": {
"user_name": "<user-email>"
}
}