STAPLEHIRE_KEY (never browser login), install the CLI, and rely on JSON output with stable exit codes for assertions.
Set up the key
Create an API key in Settings → Developers and store it as a CI secret namedSTAPLEHIRE_KEY. Then verify it in the pipeline:
CI examples
- GitHub Actions
- GitLab CI
- Plain shell
Environment variables
Clean JSON output
Use-q (or pipe stdout) so scripts get JSON without human status lines. jq -e makes assertions fail the job when a field is missing.
Common errors
FAQ
Should CI run `staplehire login`?
Should CI run `staplehire login`?
No.
login opens a browser. Set STAPLEHIRE_KEY as a secret instead.`--json` or `-q`?
`--json` or `-q`?
Use
-q for JSON-only output that also suppresses human status lines. Output is already JSON when stdout is piped, but -q guarantees it in any context.Can CI create roles and candidates?
Can CI create roles and candidates?
Yes — if the key has permission and the command includes every required flag.