# Indeed "401 unauthorized" on the agent's sponsored-jobs API call after the key rotated

## TL;DR

The API key rotated and the agent kept calling with the old one. Update the stored key, verify with a harmless read, and add rotation to the runbook with all consumers listed. Rotated keys break every consumer that nobody updated.

```text
401 Unauthorized (Indeed sponsored-jobs API, key rotated)
```

## Steps

1. Confirm the rotation: check the key's rotation timestamp against the first 401.
   Expected: They coincide.

2. Update the agent's stored key to the new value.
   Expected: Calls authenticate again.

3. Verify with a read-only call before resuming job operations.
   Expected: The key works before it matters.

4. Audit all consumers of that key; update each.
   Expected: No consumer is left on the old key.

5. Add the key to a rotation runbook with its consumer list.
   Expected: The next rotation updates everyone.

## When to use

- Indeed 401s after a key rotation
- sponsored-jobs calls fail auth
- the key is shared

## When not to use

- the 401 predates the rotation (different cause)
- the key is correct but the account is suspended (check the account)
- the error is on a different endpoint with different auth (check the docs)

## Tool compatibility

- Indeed sponsored-jobs API
- API key lifecycle

## Variant phrasings

- "indeed 401 unauthorized api key"
- "indeed sponsored jobs key rotated"
- "indeed api key rotation 401"

## Why it happens

Key rotation is only complete when every consumer has the new key, and the sponsored-jobs caller is easy to forget because it runs on a schedule nobody watches. The 401s are the API saying the rotation is half-done. The runbook with the consumer list is what makes the next rotation complete.

## Edge cases

- test in the sandbox first if Indeed offers one; key formats can differ
- the consumer list must be maintained, or it rots like the spreadsheet in item 132
- reconcile any missed job operations from the 401 window

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_D_SZJSFdn9qcuyN2yUyWvw
