What 202 means
A202 means the request was accepted and validated, not that the work succeeded. Two things follow from that:
- Credits are usually spent by the background work, not the call. A
202is not a receipt. - Failure arrives later. A job can accept cleanly and then fail per row, or find nothing at all.
200 or 201 has already finished by the time you read it.
Which handle to poll
Following a list that is filling
Saving a search to a list and committing an import both work the same way: the list exists immediately and fills in the background. Read the list and watchcompletionStatus.
Following a job
Job pollers report progress and, where the work bills, what it has spent so far:failedRows is worth reading on every poll. A job can complete with failures — those rows simply have no answer — and nothing else will tell you.
Following a research run
Research runs report a stream of events rather than a percentage, because the interesting part is what the run is doing:seq. Pass the last one you saw as sinceSeq on the next call to get only what is new, and stop when the run’s status is terminal.
How often to poll
Every poll counts against your rate limit, and several families share one bucket. A few rules that keep you inside it:1
Wait before the first poll
Nothing meaningful has happened one second after a 202.
2
Back off as it runs
A few seconds apart early, then widen. Long jobs rarely need per-second resolution.
3
Use the cursor where there is one
sinceSeq on research events returns only new events instead of the whole history.4
Stop on a terminal status
Poll a finished job and you are spending rate limit on a fixed answer.
429, wait for the window named in the response headers rather than retrying immediately.