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.
The cronjob object
Section titled “The cronjob object”CronjobDetail:
| Field | Type | Notes |
|---|---|---|
id | number | |
name | string | null | |
repositoryName | string | null | owner/repo. |
branch | string | null | |
organizationId | string | |
autoDeploy | boolean | |
baseDir | string | null | |
language | nodejs | python | go | docker | string | null | |
buildCmd / startCmd | string | null | |
region | string | null | |
cronSchedule | string | null | 5-field cron. |
instanceType | string | null | micro | mini | large | xlarge. |
imageSource | github | public_image | string | null | |
publicImage | string | null | e.g. nginx:latest. |
dockerBuildContextDir | string | null | |
dockerfilePath | string | null | |
dockerBuildArgs | unknown | null | |
status | enum | string | null | pending | deploying | running | failed | deleting | deleted | updating | paused. |
isActive | boolean | |
env | EnvVar[] | Secrets excluded. |
runStats | object | { totalRuns, successfulRuns, failedRuns, lastRunAt, nextRunAt }. |
createdAt / updatedAt | string | null |
CronjobListItem is a compact variant that also carries runStats and adds top-level cronSchedule, region, instanceType, language, imageSource, status, isActive.
List cronjobs
Section titled “List cronjobs”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 }.
curl "https://api.pandastack.io/v1/cronjobs?page=1&pageSize=20" \ -H "Authorization: Bearer $PANDASTACK_TOKEN"Create a cronjob
Section titled “Create a cronjob”POST /v1/cronjobs
Creates a cronjob (paid). For private-repo GitHub sources, the commit is resolved via the GitHub App.
Auth: member. Body (CreateCronjobInput):
| Field | Type | Required | Notes |
|---|---|---|---|
name | string | yes | 1–52 chars; ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$. |
imageSource | github | public_image | no | Default github. |
cronSchedule | string | yes | 1–120 chars, 5-field cron (e.g. */5 * * * *). |
region | string | no | Default us. |
instanceType | micro | mini | large | xlarge | no | Default micro. |
repositoryName | string | conditional | owner/repo; required when imageSource=github. |
branch | string | no | Default main. |
isPublic | boolean | no | Default true. |
language | nodejs | python | go | docker | no | Default nodejs. |
baseDir | string | no | Default ./. |
buildCmd / startCmd | string | no | Default "". |
dockerfilePath | string | no | Default ./Dockerfile. |
dockerBuildContextDir | string | no | Default ./. |
autoDeploy | boolean | no | Default false. |
publicImage | string | conditional | e.g. nginx:latest; required when imageSource=public_image. |
command | string | no | Default "". |
env | EnvVar[] | no | Default []. |
secrets | EnvVar[] | no | Default []; never returned. |
Response (CronjobMutationResult): { id, name, status, deploymentUuid }.
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:
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 a cronjob
Section titled “Get a cronjob”GET /v1/cronjobs/:name
Auth: any member. Returns CronjobDetail.
Update a cronjob
Section titled “Update a cronjob”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 a cronjob
Section titled “Delete a cronjob”DELETE /v1/cronjobs/:name
Auth: member. Response: { success: true }.
Pause / resume
Section titled “Pause / resume”POST /v1/cronjobs/:name/pause (member) — sets the cronjob inactive. Returns CronjobMutationResult.
POST /v1/cronjobs/:name/resume (member) — sets the cronjob active. Returns CronjobMutationResult.
Trigger a run now
Section titled “Trigger a run now”POST /v1/cronjobs/:name/trigger
Runs the cronjob immediately, out-of-band.
Auth: member. Response (TriggerCronjobResult): { executionUuid, status }.
curl -X POST https://api.pandastack.io/v1/cronjobs/nightly-sync/trigger \ -H "Authorization: Bearer $PANDASTACK_TOKEN"Executions
Section titled “Executions”List executions
Section titled “List executions”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:
| Field | Type | Notes |
|---|---|---|
id | number | |
cronjobId | number | null | |
executionUuid | string | null | |
status | queued | running | succeeded | failed | string | null | |
startedAt / completedAt | string | null | |
exitCode | number | null | |
errorMessage | string | null | |
createdAt / updatedAt | string | null |
Execution logs
Section titled “Execution logs”GET /v1/cronjobs/executions/:uuid/logs
Logs for a single cronjob run.
Auth: any member. Response: { logs }.
curl https://api.pandastack.io/v1/cronjobs/executions/exec-uuid/logs \ -H "Authorization: Bearer $PANDASTACK_TOKEN"Related
Section titled “Related”- Functions API — scheduled functions — the lightweight alternative for running an edge function on a cron.
- Usage & limits API — cronjob run counts and plan gating.