Skip to main content

Documentation Index

Fetch the complete documentation index at: https://staplehire.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Use jobs poll after async commands like sourcing start and candidates enrich before reading generated results.
JOB_ID=$(staplehire candidates enrich <candidateId> | jq -r '.job.id')
staplehire jobs poll "$JOB_ID" --interval 2000 --timeout 120000

Quickstart

JOB_ID=$(staplehire sourcing start <roleId> | jq -r '.job.id')
staplehire jobs poll "$JOB_ID"
staplehire sourcing prospects <roleId>
Example poll output:
{
  "job": {
    "id": "job_...",
    "type": "source_role_prospects",
    "status": "done",
    "role_id": "550e8400-e29b-41d4-a716-446655440000",
    "result": {}
  }
}

Parameters

FlagRequiredDescription
<jobId>YesJob ID returned by an async command
--interval <ms>NoPoll interval in milliseconds
--timeout <ms>NoMaximum wait time before exit code 9

Job statuses

StatusMeaning
pendingJob is queued
claimedWorker is processing the job
doneJob completed successfully
failedJob failed

Exit codes

CodeMeaning
0Job reached done
1Job reached failed
9Poll timed out; job may still be running

Examples

Poll with a longer timeout

staplehire jobs poll <jobId> --interval 5000 --timeout 300000

Inspect a job without blocking

staplehire jobs get <jobId>

List recent sourcing jobs for a role

staplehire jobs list --role-id <roleId> --type source_role_prospects --include-history

Common errors

ErrorCauseFix
Exit code 9Timeout elapsedRe-run jobs poll, increase --timeout, or inspect with jobs get
NotFoundErrorJob ID is wrongUse the job.id returned by the async command
failed statusWorker failed the jobRead the job result and retry the source command if appropriate

FAQ

Does timeout cancel the job?

No. Exit code 9 means the CLI stopped waiting. The job may still finish later.

Which commands create jobs?

candidates enrich, sourcing start, and some interview design generation flows create async jobs.

Should agents always poll?

Yes. Agents should poll after async commands before reading results. Related: Source candidates with the Staplehire CLI · Enrich a candidate with the Staplehire CLI · CLI errors