Automation · APIs
API Keys
Cheat sheet · https://pcornel.dk/topic.php?topic=5312
Answer
Static or semi-static secret values used by APIs to identify and sometimes authorize a calling application or tenant.
Remember
- API key ≠ user identity; keys often represent an application, project or tenant rather than a human.
- Key present ≠ authorized for every operation; server-side scope or product entitlement may still deny access.
- Key in URL ≠ safe transport; query strings leak easily into logs, history and proxies.
- Key rotated ≠ old key unusable automatically; overlap and revocation windows may exist.
First checks
curl -sS -H 'X-API-Key: <key>' <url>— key header- Key scope and IP restrictions — limits
- Key rotation date — age
Verify in this order
key → header → API
Where it usually breaks
Possession of a valid API key proves only access to that credential; authorization and caller attribution depend on server policy.
API Keys API boundary map
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Caller / request | Environment/version, identity and exact request contract are attributable | Hidden defaults, wrong endpoint/version, leaked or mismatched credentials |
| Server / response | Status, headers, structured body and request ID are interpreted together | Status-only handling, ignored error body, ambiguous async result or unsafe retry |
| State / proof | Write result is reconciled with resource read-back or acceptance test | Response success treated as final target success without verification |
| Troubleshooting | First failed boundary is preserved, changed minimally and retested | Blind retries, credential rotation, replay or payload edits before evidence is captured |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5312