Skip to navigation

Asynchronous jobs

Bulk operations such as adjustments create-bulk return 202 Accepted with a job_id instead of the final result. The API processes the items in the background; the CLI provides two ways to follow the job.

Submit a job

deel adjustments create-bulk --invoice --input file://adjustments.json
{
"data": {
"job_id": "7f3c9b1e-2d84-4a51-9c07-1b5e8a0f3d62",
"items": [
{ "external_id": "bonus-2026-09-alice", "status": "PENDING" },
{ "external_id": "bonus-2026-09-bob", "status": "PENDING" }
]
},
"meta": { "request_id": "8b1c1a2e-3f96-4d05-a172-9e6b8c4d0f13" }
}

Each item echoes the external_id you supplied, so you can correlate results with your own records. Use --quiet to capture only the job id:

JOB_ID=$(deel adjustments create-bulk --invoice --input file://adjustments.json --quiet)

Follow a job

Four commands follow a job, split between the job and jobs groups:

CommandGroupDescription
deel job status <id>[,<id>]jobFetch one or more jobs by id in a single command
deel job listjobList recent jobs
deel jobs status --job_id <id>jobsRetrieve one job by id
deel jobs list [--limit n] [--cursor c]jobsList jobs with pagination parameters

job (singular) accepts several comma-separated ids and returns an array when more than one is given. jobs (plural) adds pagination parameters for listing. Both read the same job data.

deel job status 7f3c9b1e-2d84-4a51-9c07-1b5e8a0f3d62
{
"data": {
"job_id": "7f3c9b1e-2d84-4a51-9c07-1b5e8a0f3d62",
"status": "SUCCEEDED",
"items": [
{ "external_id": "bonus-2026-09-alice", "status": "SUCCEEDED" },
{ "external_id": "bonus-2026-09-bob", "status": "FAILED", "error": { "code": "http.422", "message": "amount: must be a positive number" } }
]
}
}

Job statuses

A job moves through four statuses:

StatusMeaning
PENDINGAccepted, not yet started
RUNNINGItems are being processed
SUCCEEDEDEvery item completed successfully
FAILEDAt least one item failed; inspect items[].error from deel jobs status

A job in SUCCEEDED or FAILED is terminal and does not change afterwards.

Wait for completion in a script

Submitting a job returns immediately; the CLI does not wait for it to finish. Poll with deel job status until it reaches a terminal status:

JOB_ID=$(deel adjustments create-bulk --invoice --input file://adjustments.json --quiet)
while :; do
STATUS=$(deel job status "$JOB_ID" --jq '.status' --raw)
case "$STATUS" in
SUCCEEDED|FAILED) break ;;
esac
sleep 5
done
deel jobs status --job_id="$JOB_ID" --jq '.items[] | select(.status == "FAILED")'

Poll every 5 seconds; the CLI automatically retries job lookups on 429 and 5xx responses.

Next steps