Skip to content

Cronjobs API

A cronjob is a scheduled container build-and-run. Its source is either a GitHub repository (built for you) or a public container image. Cronjobs are a paid feature. Env is exposed as { name, value } pairs; secrets are never returned.

Concept guide: Cronjobs overview.

All routes require authentication; role floors are noted per endpoint.

CronjobDetail:

FieldTypeNotes
idnumber
namestring | null
repositoryNamestring | nullowner/repo.
branchstring | null
organizationIdstring
autoDeployboolean
baseDirstring | null
languagenodejs | python | go | docker | string | null
buildCmd / startCmdstring | null
regionstring | null
cronSchedulestring | null5-field cron.
instanceTypestring | nullmicro | mini | large | xlarge.
imageSourcegithub | public_image | string | null
publicImagestring | nulle.g. nginx:latest.
dockerBuildContextDirstring | null
dockerfilePathstring | null
dockerBuildArgsunknown | null
statusenum | string | nullpending | deploying | running | failed | deleting | deleted | updating | paused.
isActiveboolean
envEnvVar[]Secrets excluded.
runStatsobject{ totalRuns, successfulRuns, failedRuns, lastRunAt, nextRunAt }.
createdAt / updatedAtstring | null

CronjobListItem is a compact variant that also carries runStats and adds top-level cronSchedule, region, instanceType, language, imageSource, status, isActive.


GET /v1/cronjobs

Page-paginated list of the org’s cronjobs.

Auth: any member. Query (CronjobListQuery): page (default 1), pageSize (default 20, max 100).

Response (CronjobListPage): { items: CronjobListItem[], total }.

Terminal window
curl "https://api.pandastack.io/v1/cronjobs?page=1&pageSize=20" \
-H "Authorization: Bearer $PANDASTACK_TOKEN"

POST /v1/cronjobs

Creates a cronjob (paid). For private-repo GitHub sources, the commit is resolved via the GitHub App.

Auth: member. Body (CreateCronjobInput):

FieldTypeRequiredNotes
namestringyes1–52 chars; ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$.
imageSourcegithub | public_imagenoDefault github.
cronSchedulestringyes1–120 chars, 5-field cron (e.g. */5 * * * *).
regionstringnoDefault us.
instanceTypemicro | mini | large | xlargenoDefault micro.
repositoryNamestringconditionalowner/repo; required when imageSource=github.
branchstringnoDefault main.
isPublicbooleannoDefault true.
languagenodejs | python | go | dockernoDefault nodejs.
baseDirstringnoDefault ./.
buildCmd / startCmdstringnoDefault "".
dockerfilePathstringnoDefault ./Dockerfile.
dockerBuildContextDirstringnoDefault ./.
autoDeploybooleannoDefault false.
publicImagestringconditionale.g. nginx:latest; required when imageSource=public_image.
commandstringnoDefault "".
envEnvVar[]noDefault [].
secretsEnvVar[]noDefault []; never returned.

Response (CronjobMutationResult): { id, name, status, deploymentUuid }.

Terminal window
curl -X POST https://api.pandastack.io/v1/cronjobs \
-H "Authorization: Bearer $PANDASTACK_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "nightly-sync",
"imageSource": "github",
"repositoryName": "acme/jobs",
"branch": "main",
"language": "nodejs",
"cronSchedule": "0 3 * * *",
"instanceType": "micro",
"startCmd": "node sync.js"
}'

For a public image instead:

Terminal window
curl -X POST https://api.pandastack.io/v1/cronjobs \
-H "Authorization: Bearer $PANDASTACK_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "healthcheck",
"imageSource": "public_image",
"publicImage": "curlimages/curl:latest",
"command": "curl -sf https://example.com",
"cronSchedule": "*/10 * * * *"
}'

GET /v1/cronjobs/:name

Auth: any member. Returns CronjobDetail.

PATCH /v1/cronjobs/:name

Auth: member. Body (UpdateCronjobInput) — all optional: cronSchedule, instanceType, branch, language, baseDir, buildCmd, startCmd, dockerfilePath, dockerBuildContextDir, autoDeploy, publicImage, command, env, secrets. Response: CronjobMutationResult.

DELETE /v1/cronjobs/:name

Auth: member. Response: { success: true }.

POST /v1/cronjobs/:name/pause (member) — sets the cronjob inactive. Returns CronjobMutationResult.

POST /v1/cronjobs/:name/resume (member) — sets the cronjob active. Returns CronjobMutationResult.

POST /v1/cronjobs/:name/trigger

Runs the cronjob immediately, out-of-band.

Auth: member. Response (TriggerCronjobResult): { executionUuid, status }.

Terminal window
curl -X POST https://api.pandastack.io/v1/cronjobs/nightly-sync/trigger \
-H "Authorization: Bearer $PANDASTACK_TOKEN"

GET /v1/cronjobs/:name/executions

Page-paginated list of a cronjob’s executions.

Auth: any member. Query (ExecutionListQuery): page (default 1), pageSize (default 20, max 100). Response (ExecutionListPage): { items: CronjobExecution[], total }.

CronjobExecution:

FieldTypeNotes
idnumber
cronjobIdnumber | null
executionUuidstring | null
statusqueued | running | succeeded | failed | string | null
startedAt / completedAtstring | null
exitCodenumber | null
errorMessagestring | null
createdAt / updatedAtstring | null

GET /v1/cronjobs/executions/:uuid/logs

Logs for a single cronjob run.

Auth: any member. Response: { logs }.

Terminal window
curl https://api.pandastack.io/v1/cronjobs/executions/exec-uuid/logs \
-H "Authorization: Bearer $PANDASTACK_TOKEN"