API Documentation

Rerun Jobs

POST/api/rerun-job

The POST API endpoint /rerun-job puts a Complete or Stopped job back in the queue, as the Rerun button on its page does: the same job, under the same name and with the same settings, its earlier outputs replaced as it runs. Send a batch name to rerun the batch's jobs. Rerunning is available on Premium plans.

Parameters:
jobName(string, required)

Name of the job to rerun. For a batch, the batch name: its jobs are rerun.

only(string, optional)

For a batch only: "all" (the default) reruns every job in it, "incomplete" every job that is not Complete. The batch itself must be Complete or Stopped.

Note: a job that is still Running or In Queue can't be rerun; stop it first with /stop-job. A pipeline step's job can be rerun once it is Stopped. A rerun passes the checks a new submission passes: access to the job's tool, ownership of every file and molecule the job reads, your queue limit and your compute budgets. When a rerun is refused nothing is changed, and the JSON body's error says why; a plan without reruns answers 403 with "requiresPremium": true.

HTTP Response Status Codes
Status codeDescription
200The job, or the batch's jobs, are back in the queue
400Missing or invalid API key, missing "jobName", no job of yours has that name, the job can't be rerun in its status, a bad "only", nothing to rerun, a refused parent model, or your queue is full
403Your plan doesn't include reruns ("requiresPremium": true), the tool or its licence is no longer available to you ("toolDenied": true), an input is no longer yours to read, or a compute budget would be exceeded
409The job's inputs were never ingested or are still being ingested, or its settings are stored apart from it
502A pipeline step's job: its pipeline state was reopened but the rerun could not be confirmed; check the job before retrying
503A check could not be made right now and nothing was changed; send the same request again
1import requests
2
3api_key = "insert-api-key-here"
4headers = {'x-api-key': api_key}
5base_url = "https://app.tamarind.bio/api/"
6
7# A job: runs again under the same name, with the same settings.
8response = requests.post(base_url + "rerun-job", headers=headers, json={"jobName": "myJobName"})
9print(response.status_code, response.json())
10
11# A batch: rerun only the jobs that did not complete.
12response = requests.post(base_url + "rerun-job", headers=headers,
13                         json={"jobName": "myBatchName", "only": "incomplete"})
14print(response.status_code, response.json())
Response Format
1{
2  "message": "myJobName rerun",
3  "rerunCount": 1
4}