Skip to main content
PATCH
/
api
/
v1
/
jobs
/
{id}
PATCH jobs
curl --request PATCH \
  --url https://app.onecodex.com/api/v1/jobs/{id} \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "arguments_schema": [
    {
      "description": "<string>",
      "fa_icon": "<string>",
      "fields": [
        {
          "name": "<string>",
          "choices": [
            "<string>"
          ],
          "default": null,
          "description": "<string>",
          "env_name": "",
          "fa_icon": "<string>",
          "help_text": "<string>",
          "pattern": "<string>",
          "required": false
        }
      ],
      "title": "<string>"
    }
  ],
  "assets": [
    {
      "__DOLLAR_REF__": "/api/v1/assets/a1b2c3d4e5f67890"
    }
  ],
  "autorun_on_org_sample_upload": true,
  "cpu": 123,
  "dependencies": [
    {
      "job": {
        "__DOLLAR_REF__": "/api/v1/jobs/a1b2c3d4e5f67890"
      },
      "output_dir": "<string>"
    }
  ],
  "description": "<string>",
  "image_uri": "<string>",
  "inject_bearer_token": true,
  "name": "<string>",
  "ram_gb": 123,
  "repository": {
    "url": "<string>",
    "tag": "<string>"
  },
  "script": "<string>",
  "storage_gb": 123
}
'
import requests

url = "https://app.onecodex.com/api/v1/jobs/{id}"

payload = {
"arguments_schema": [
{
"description": "<string>",
"fa_icon": "<string>",
"fields": [
{
"name": "<string>",
"choices": ["<string>"],
"default": None,
"description": "<string>",
"env_name": "",
"fa_icon": "<string>",
"help_text": "<string>",
"pattern": "<string>",
"required": False
}
],
"title": "<string>"
}
],
"assets": [{ "__DOLLAR_REF__": "/api/v1/assets/a1b2c3d4e5f67890" }],
"autorun_on_org_sample_upload": True,
"cpu": 123,
"dependencies": [
{
"job": { "__DOLLAR_REF__": "/api/v1/jobs/a1b2c3d4e5f67890" },
"output_dir": "<string>"
}
],
"description": "<string>",
"image_uri": "<string>",
"inject_bearer_token": True,
"name": "<string>",
"ram_gb": 123,
"repository": {
"url": "<string>",
"tag": "<string>"
},
"script": "<string>",
"storage_gb": 123
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
arguments_schema: [
{
description: '<string>',
fa_icon: '<string>',
fields: [
{
name: '<string>',
choices: ['<string>'],
default: null,
description: '<string>',
env_name: '',
fa_icon: '<string>',
help_text: '<string>',
pattern: '<string>',
required: false
}
],
title: '<string>'
}
],
assets: [{__DOLLAR_REF__: '/api/v1/assets/a1b2c3d4e5f67890'}],
autorun_on_org_sample_upload: true,
cpu: 123,
dependencies: [
{job: {__DOLLAR_REF__: '/api/v1/jobs/a1b2c3d4e5f67890'}, output_dir: '<string>'}
],
description: '<string>',
image_uri: '<string>',
inject_bearer_token: true,
name: '<string>',
ram_gb: 123,
repository: {url: '<string>', tag: '<string>'},
script: '<string>',
storage_gb: 123
})
};

fetch('https://app.onecodex.com/api/v1/jobs/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://app.onecodex.com/api/v1/jobs/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'arguments_schema' => [
[
'description' => '<string>',
'fa_icon' => '<string>',
'fields' => [
[
'name' => '<string>',
'choices' => [
'<string>'
],
'default' => null,
'description' => '<string>',
'env_name' => '',
'fa_icon' => '<string>',
'help_text' => '<string>',
'pattern' => '<string>',
'required' => false
]
],
'title' => '<string>'
]
],
'assets' => [
[
'__DOLLAR_REF__' => '/api/v1/assets/a1b2c3d4e5f67890'
]
],
'autorun_on_org_sample_upload' => true,
'cpu' => 123,
'dependencies' => [
[
'job' => [
'__DOLLAR_REF__' => '/api/v1/jobs/a1b2c3d4e5f67890'
],
'output_dir' => '<string>'
]
],
'description' => '<string>',
'image_uri' => '<string>',
'inject_bearer_token' => true,
'name' => '<string>',
'ram_gb' => 123,
'repository' => [
'url' => '<string>',
'tag' => '<string>'
],
'script' => '<string>',
'storage_gb' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://app.onecodex.com/api/v1/jobs/{id}"

payload := strings.NewReader("{\n \"arguments_schema\": [\n {\n \"description\": \"<string>\",\n \"fa_icon\": \"<string>\",\n \"fields\": [\n {\n \"name\": \"<string>\",\n \"choices\": [\n \"<string>\"\n ],\n \"default\": null,\n \"description\": \"<string>\",\n \"env_name\": \"\",\n \"fa_icon\": \"<string>\",\n \"help_text\": \"<string>\",\n \"pattern\": \"<string>\",\n \"required\": false\n }\n ],\n \"title\": \"<string>\"\n }\n ],\n \"assets\": [\n {\n \"__DOLLAR_REF__\": \"/api/v1/assets/a1b2c3d4e5f67890\"\n }\n ],\n \"autorun_on_org_sample_upload\": true,\n \"cpu\": 123,\n \"dependencies\": [\n {\n \"job\": {\n \"__DOLLAR_REF__\": \"/api/v1/jobs/a1b2c3d4e5f67890\"\n },\n \"output_dir\": \"<string>\"\n }\n ],\n \"description\": \"<string>\",\n \"image_uri\": \"<string>\",\n \"inject_bearer_token\": true,\n \"name\": \"<string>\",\n \"ram_gb\": 123,\n \"repository\": {\n \"url\": \"<string>\",\n \"tag\": \"<string>\"\n },\n \"script\": \"<string>\",\n \"storage_gb\": 123\n}")

req, _ := http.NewRequest("PATCH", url, payload)

req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.patch("https://app.onecodex.com/api/v1/jobs/{id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"arguments_schema\": [\n {\n \"description\": \"<string>\",\n \"fa_icon\": \"<string>\",\n \"fields\": [\n {\n \"name\": \"<string>\",\n \"choices\": [\n \"<string>\"\n ],\n \"default\": null,\n \"description\": \"<string>\",\n \"env_name\": \"\",\n \"fa_icon\": \"<string>\",\n \"help_text\": \"<string>\",\n \"pattern\": \"<string>\",\n \"required\": false\n }\n ],\n \"title\": \"<string>\"\n }\n ],\n \"assets\": [\n {\n \"__DOLLAR_REF__\": \"/api/v1/assets/a1b2c3d4e5f67890\"\n }\n ],\n \"autorun_on_org_sample_upload\": true,\n \"cpu\": 123,\n \"dependencies\": [\n {\n \"job\": {\n \"__DOLLAR_REF__\": \"/api/v1/jobs/a1b2c3d4e5f67890\"\n },\n \"output_dir\": \"<string>\"\n }\n ],\n \"description\": \"<string>\",\n \"image_uri\": \"<string>\",\n \"inject_bearer_token\": true,\n \"name\": \"<string>\",\n \"ram_gb\": 123,\n \"repository\": {\n \"url\": \"<string>\",\n \"tag\": \"<string>\"\n },\n \"script\": \"<string>\",\n \"storage_gb\": 123\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://app.onecodex.com/api/v1/jobs/{id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"arguments_schema\": [\n {\n \"description\": \"<string>\",\n \"fa_icon\": \"<string>\",\n \"fields\": [\n {\n \"name\": \"<string>\",\n \"choices\": [\n \"<string>\"\n ],\n \"default\": null,\n \"description\": \"<string>\",\n \"env_name\": \"\",\n \"fa_icon\": \"<string>\",\n \"help_text\": \"<string>\",\n \"pattern\": \"<string>\",\n \"required\": false\n }\n ],\n \"title\": \"<string>\"\n }\n ],\n \"assets\": [\n {\n \"__DOLLAR_REF__\": \"/api/v1/assets/a1b2c3d4e5f67890\"\n }\n ],\n \"autorun_on_org_sample_upload\": true,\n \"cpu\": 123,\n \"dependencies\": [\n {\n \"job\": {\n \"__DOLLAR_REF__\": \"/api/v1/jobs/a1b2c3d4e5f67890\"\n },\n \"output_dir\": \"<string>\"\n }\n ],\n \"description\": \"<string>\",\n \"image_uri\": \"<string>\",\n \"inject_bearer_token\": true,\n \"name\": \"<string>\",\n \"ram_gb\": 123,\n \"repository\": {\n \"url\": \"<string>\",\n \"tag\": \"<string>\"\n },\n \"script\": \"<string>\",\n \"storage_gb\": 123\n}"

response = http.request(request)
puts response.read_body
{
  "$uri": "/api/v1/jobs/0d77065796f8d173",
  "analysis_type": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "job_args_schema": {},
  "name": "<string>",
  "public": true
}
Update the human-readable metadata of an existing Job — its description, visibility, asset dependencies, and so on.

Authorizations

X-API-Key
string
header
required

Path Parameters

id
string
required

Body

application/json
arguments_schema
FieldGroup · object[] | null

The schema for the arguments to parametrize this job. Each field is exposed in the script as $ARGS_<UPPER_NAME>. Example: [{"fields": [{"name": "min_quality", "type": "integer"}, {"name": "adapter", "type": "string"}]}]. The input sample is not a parameter; it is passed separately at run time

assets
Assets · object[] | null

An optional list of assets associated with this job

autorun_on_org_sample_upload
boolean | null

Whether to automatically run this job on every newly uploaded sample in the user's organization. Only available to organization admins on published jobs.

cpu
number | null

The number of CPU cores used for this job, set only for shell script jobs

dependencies
JobDependencySchema · object[] | null

Optional job dependencies for this job. If provided, will be triggered automatically when this job is run

description
string | null

The human-readable description of the job. Supports markdown

image_uri
string | null

Fully qualified, publicly available OCI image URI containing every tool the script uses. Examples: docker.io/biocontainers/fastqc:v0.11.9_cv8, docker.io/library/python:3.12. Don't use Docker Hub shorthand forms such as python:3.12 or python/3.12

Minimum string length: 1
inject_bearer_token
boolean | null

Whether to inject the user's One Codex bearer token into the analysis job, exposed as $ONE_CODEX_BEARER_TOKEN

name
string | null

The human-readable name of the job

Minimum string length: 1
ram_gb
number | null

The amount of RAM used for this job in GB, set only for shell script jobs

repository
RepositorySchema · object | null

The git repository that this job runs against

script
string | null

The script to be executed, runs as non-root user

Minimum string length: 1
storage_gb
number | null

The amount of storage used for this job in GB, set only for shell script jobs

Response

200 - application/json

OK

$uri
string
required
read-only
Pattern: ^/api/v1/jobs/[a-f0-9]{16}$
Example:

"/api/v1/jobs/0d77065796f8d173"

analysis_type
string
required

The type of analysis. See the analysis resource for more details.

created_at
string<date-time>
required

Timestamp for when the object was created on the One Codex platform, encoded as a RFC 3339 timestamp.

job_args_schema
Job Args Schema · object
required

The JSON schema for the arguments taken by the job (can be an empty object, i.e., {}).

name
string
required

The name of the job (this is displayed in the dropdown on the analysis page of the One Codex web application).

public
boolean
required

Whether the job is publicly available. For most jobs this will be true. Custom, private jobs are also available, and will only be visible to users whose samples (or samples shared with them) have been analyzed using that job.