Skip to content
Kapten
Esc
↑↓navigate↵open⌘Jpreview

Create a job

Creates a cron or one-off job in an environment.

POST/project/{project_id}/environment/{environment_id}/job
Authorization
AuthorizationBearer token (JWT) · headerrequired

JWT token passed in the Authorization header using the Bearer <token> format.

Path parameters
project_iduuidrequired

The unique identifier for the project

environment_iduuidrequired

The unique identifier of the environment

Request body
requiredapplication/json
namestringrequired

Name of the job

min length 1 · matches \S
descriptionstring
timezonestring<timezone>

Specifies the timezone for the cron job. Defaults to UTC.

cronstring<cron>

Specifies the job schedule using standard cron format (minute hour day month weekday). Does not include seconds field - follows the traditional 5-field cron syntax.

configurationobjectrequired
Show properties
cpu_limit_in_millistring

Maximum cpu that can be allocated to the job based on organization cluster configuration. unit is millicores (m). 1000m = 1 cpu

ram_limit_in_mibstring

Maximum memory that can be allocated to the job based on organization cluster configuration. unit is MB. 1024 MB = 1GB

cpu_request_in_millistring

unit is millicores (m). 1000m = 1 cpu

ram_request_in_mibstring

unit is MB. 1024 MB = 1GB

max_nb_restartinteger

Maximum number of restart allowed before the job is considered as failed 0 means that no restart/crash of the job is allowed

min 0
max_duration_secondsinteger

Maximum number of seconds allowed for the job to run before killing it and mark it as failed

min 0
default_portinteger | null

Port where to run readiness and liveliness probes checks. The port will not be exposed externally

min 1 · default: null
sourcecontainer_image_source
Show properties
One of:
container_image_source
image_namestringrequired

image name

min length 1 · matches \S
tagstringrequired

tag of the image container

min length 1 · matches \S
healthcheckshealthcheckrequired

Configuration object for health check probes including readiness and liveness probe settings

Show properties
readiness_probeprobe | null

Configuration for health check probes used to determine the health status of a container or service. Supports multiple probe types including TCP, HTTP, exec command, and gRPC.

Show properties
typeobject
Show properties
tcpobject | null
Show properties
portinteger
hoststring | null
default: null
httpobject | null
Show properties
pathstring
default: "/"
schemestring
default: "HTTP"
portinteger
execobject | null
Show properties
commandstring[]
grpcobject | null
Show properties
servicestring | null
default: null
portinteger
initial_delay_secondsinteger
default: 30
period_secondsinteger
default: 10
timeout_secondsinteger
default: 5
success_thresholdinteger
default: 1
failure_thresholdinteger
default: 9
liveness_probeprobe | null

Configuration for health check probes used to determine the health status of a container or service. Supports multiple probe types including TCP, HTTP, exec command, and gRPC.

Show properties
typeobject
Show properties
tcpobject | null
Show properties
portinteger
hoststring | null
default: null
httpobject | null
Show properties
pathstring
default: "/"
schemestring
default: "HTTP"
portinteger
execobject | null
Show properties
commandstring[]
grpcobject | null
Show properties
servicestring | null
default: null
portinteger
initial_delay_secondsinteger
default: 30
period_secondsinteger
default: 10
timeout_secondsinteger
default: 5
success_thresholdinteger
default: 1
failure_thresholdinteger
default: 9
entrypointstring

Container entrypoint

argumentsstring[]
Responses
200

Job created successfully

iduuidrequired

A universally unique identifier (UUID) string

organization_iduuidrequired

A universally unique identifier (UUID) string

project_iduuidrequired

A universally unique identifier (UUID) string

cluster_iduuidrequired

A universally unique identifier (UUID) string

environment_iduuidrequired

A universally unique identifier (UUID) string

namestringrequired

Name of the job

descriptionstring
last_run_iduuid | null
Show properties
Any of:
uuid
string<uuid>
null
null
last_run_statuscomponent_deployment_state

Deployment state for a component resource.

Allowed:QUEUEDSCHEDULEDRUNNINGRETRYINGSUCCEEDEDFAILEDCANCELEDTIMED_OUTSKIPPEDNONE
typejob_typerequired

Indicates whether the job is a cron or one-time execution.

Allowed:cronone_time
timezonestring<timezone>

Specifies the timezone for the cron job. Defaults to UTC.

cronstring<cron>

Specifies the job schedule using standard cron format (minute hour day month weekday). Does not include seconds field - follows the traditional 5-field cron syntax.

configurationobjectrequired
Show properties
cpu_limit_in_millistringrequired

Maximum cpu that can be allocated to the job based on organization cluster configuration. unit is millicores (m). 1000m = 1 cpu

ram_limit_in_mibstringrequired

Maximum memory that can be allocated to the job based on organization cluster configuration. unit is MB. 1024 MB = 1GB

cpu_request_in_millistringrequired

unit is millicores (m). 1000m = 1 cpu

ram_request_in_mibstringrequired

unit is MB. 1024 MB = 1GB

max_nb_restartinteger

Maximum number of restart allowed before the job is considered as failed 0 means that no restart/crash of the job is allowed

min 0
max_duration_secondsinteger

Maximum number of seconds allowed for the job to run before killing it and mark it as failed

min 0
default_portinteger | null

Port where to run readiness and liveliness probes checks. The port will not be exposed externally

min 1 · default: null
sourcecontainer_image_sourcerequired
Show properties
One of:
container_image_source
image_namestringrequired

image name

min length 1 · matches \S
tagstringrequired

tag of the image container

min length 1 · matches \S
healthcheckshealthcheckrequired

Configuration object for health check probes including readiness and liveness probe settings

Show properties
readiness_probeprobe | null

Configuration for health check probes used to determine the health status of a container or service. Supports multiple probe types including TCP, HTTP, exec command, and gRPC.

Show properties
typeobject
Show properties
tcpobject | null
Show properties
portinteger
hoststring | null
default: null
httpobject | null
Show properties
pathstring
default: "/"
schemestring
default: "HTTP"
portinteger
execobject | null
Show properties
commandstring[]
grpcobject | null
Show properties
servicestring | null
default: null
portinteger
initial_delay_secondsinteger
default: 30
period_secondsinteger
default: 10
timeout_secondsinteger
default: 5
success_thresholdinteger
default: 1
failure_thresholdinteger
default: 9
liveness_probeprobe | null

Configuration for health check probes used to determine the health status of a container or service. Supports multiple probe types including TCP, HTTP, exec command, and gRPC.

Show properties
typeobject
Show properties
tcpobject | null
Show properties
portinteger
hoststring | null
default: null
httpobject | null
Show properties
pathstring
default: "/"
schemestring
default: "HTTP"
portinteger
execobject | null
Show properties
commandstring[]
grpcobject | null
Show properties
servicestring | null
default: null
portinteger
initial_delay_secondsinteger
default: 30
period_secondsinteger
default: 10
timeout_secondsinteger
default: 5
success_thresholdinteger
default: 1
failure_thresholdinteger
default: 9
entrypointstring

Container entrypoint

argumentsstring[]
default

Error

codeinteger<int32>required
messagestringrequired
reasonstring

Optional stable machine-readable reason for programmatic error handling

Request
curl -X POST 'https://api.kapten.io/project/497f6eca-6276-4993-bfeb-53cbbbba6f08/environment/497f6eca-6276-4993-bfeb-53cbbbba6f08/job' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "description": "string",
  "timezone": "string",
  "cron": "string",
  "configuration": {
    "cpu_limit_in_milli": "2000m",
    "ram_limit_in_mib": "2048Mi",
    "cpu_request_in_milli": "1000m",
    "ram_request_in_mib": "1024Mi",
    "max_nb_restart": 0,
    "max_duration_seconds": 0,
    "default_port": null,
    "source": {
      "image_name": "string",
      "tag": "string"
    },
    "healthchecks": {
      "readiness_probe": {
        "type": {
          "tcp": {
            "port": 0,
            "host": null
          },
          "http": {
            "path": "/",
            "scheme": "HTTP",
            "port": 0
          },
          "exec": {
            "command": [
              "string"
            ]
          },
          "grpc": {
            "service": null,
            "port": 0
          }
        },
        "initial_delay_seconds": 30,
        "period_seconds": 10,
        "timeout_seconds": 5,
        "success_threshold": 1,
        "failure_threshold": 9
      },
      "liveness_probe": {
        "type": {
          "tcp": {
            "port": 0,
            "host": null
          },
          "http": {
            "path": "/",
            "scheme": "HTTP",
            "port": 0
          },
          "exec": {
            "command": [
              "string"
            ]
          },
          "grpc": {
            "service": null,
            "port": 0
          }
        },
        "initial_delay_seconds": 30,
        "period_seconds": 10,
        "timeout_seconds": 5,
        "success_threshold": 1,
        "failure_threshold": 9
      }
    },
    "entrypoint": "string",
    "arguments": [
      "string"
    ]
  }
}'
Response
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
  "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",
  "cluster_id": "d3d1bfdf-67c4-41fa-b065-858242731616",
  "environment_id": "40ef0e48-a11f-4963-a229-e396c9f7e7c4",
  "name": "string",
  "description": "string",
  "last_run_id": "08df5d92-87b1-40a2-b1e7-a5977dea4efc",
  "last_run_status": "QUEUED",
  "type": "cron",
  "timezone": "string",
  "cron": "string",
  "configuration": {
    "cpu_limit_in_milli": "2000m",
    "ram_limit_in_mib": "2048Mi",
    "cpu_request_in_milli": "1000m",
    "ram_request_in_mib": "1024Mi",
    "max_nb_restart": 0,
    "max_duration_seconds": 0,
    "default_port": null,
    "source": {
      "image_name": "string",
      "tag": "string"
    },
    "healthchecks": {
      "readiness_probe": {
        "type": {
          "tcp": {
            "port": 0,
            "host": null
          },
          "http": {
            "path": "/",
            "scheme": "HTTP",
            "port": 0
          },
          "exec": {
            "command": [
              "string"
            ]
          },
          "grpc": {
            "service": null,
            "port": 0
          }
        },
        "initial_delay_seconds": 30,
        "period_seconds": 10,
        "timeout_seconds": 5,
        "success_threshold": 1,
        "failure_threshold": 9
      },
      "liveness_probe": {
        "type": {
          "tcp": {
            "port": 0,
            "host": null
          },
          "http": {
            "path": "/",
            "scheme": "HTTP",
            "port": 0
          },
          "exec": {
            "command": [
              "string"
            ]
          },
          "grpc": {
            "service": null,
            "port": 0
          }
        },
        "initial_delay_seconds": 30,
        "period_seconds": 10,
        "timeout_seconds": 5,
        "success_threshold": 1,
        "failure_threshold": 9
      }
    },
    "entrypoint": "string",
    "arguments": [
      "string"
    ]
  }
}

Was this page helpful?