Resume Parser
← Back to blogBlog

Resume parsing API errors: which to retry and which to stop on

Retry 429, 503 and 500 with a wait. Never retry 400, 401, 413 or 422 unchanged. Each status code, with what your code should do.

Herizon

Retry a failed parse only when the cause is temporary: 429 rate_limited, 503 busy and 500 server_error. Stop on 400, 401, 402, 413 and 422, because sending the same file again gives the same answer. That one rule keeps a batch job from looping on bad files and from giving up on good ones.

Here is each status from the API docs, with what your code should do.

Status by status

  • 400 invalid_file: do not retry. The upload is missing or not a PDF. Fix the request or reject the file.
  • 401 invalid_api_key: do not retry. Check the key and alert a person, since every following request will fail too.
  • 402 insufficient_credits: do not retry until credits are added. Pause the queue and tell whoever pays.
  • 413 file_too_large: do not retry. The file is over 5 MB; ask for a smaller one.
  • 422 parse_failed: do not retry. No resume data was found, usually because the PDF is a scan without a text layer. Not charged.
  • 429 rate_limited: retry after the Retry-After header: 60 seconds for the 30-per-minute limit, 5 seconds for the 2-parses-at-once limit.
  • 500 server_error: retry a few times, about a minute apart. Not charged.
  • 503 busy: retry after Retry-After (5 seconds).

Read Retry-After instead of guessing

The Retry-After header tells you how long to wait in seconds. Our API sends it with 429 and 503. Use it when present and fall back to your own backoff when not:

def wait_seconds(response, attempt: int) -> float:
    header = response.headers.get("Retry-After")
    if header and header.isdigit():
        return float(header)
    return min(60.0, 2.0 ** attempt)

Cap the number of attempts. Four attempts cover a full minute of rate limiting plus a short outage. After that, park the job and move on, so one stuck file can't hold up the rest.

Why 422 is final

A 422 means the parser read the PDF and found nothing it could turn into a resume. The common cause is a scanned PDF with no text layer, since there is no OCR. Retrying sends the same bytes to the same parser. Treat it as a message for the candidate or a recruiter instead: ask for the exported PDF, or run OCR yourself. Our post on checking a PDF for a text layer shows how to catch these before you send them.

Why 402 needs a person

402 insufficient_credits means the 50 free parses for the month are used and the account has no prepaid credits. Retrying won't help until someone buys credits in the dashboard or the free allowance resets at the start of the next month (UTC). Stop the queue, keep the jobs, and notify the account owner. GET /v1/usage returns the current numbers, so a worker can check the balance before it starts a large batch.

Timeouts are not errors from the API

A parse can take up to 60 seconds. If your HTTP client gives up at 30 seconds, you see a timeout even though the parse was fine. Set the client timeout above 60 seconds, for example 90. If a real timeout happens, you don't know whether the parse finished, so retrying once is reasonable.

Errors without a JSON body

A proxy or load balancer in front of any API can return an HTML error page during a network problem. Check the Content-Type before calling response.json(), and treat a non-JSON 5xx like a 500.

Complete retry loops in code are on the Python and JavaScript pages. The API usage FAQ covers the limits in more detail.

Questions

Which resume parsing API errors should I retry?
Retry 429 rate_limited and 503 busy after the Retry-After header, and 500 server_error after about a minute. Do not retry 400, 401, 402, 413 or 422 with the same file.
Am I charged for a failed parse?
No. 422 parse_failed and 500 server_error are not charged; only successful parses use free parses or credits.
What timeout should I set for the parse request?
Above 60 seconds, for example 90 seconds, because a single synchronous parse can take up to 60 seconds.

Want to try our parser?

Sign up with your email and get 50 free parses per month.

Get API key

Feedback

Send feedback

Tell us what went wrong or what you would like to see.

What is it about?

Sent with the address of this page. See the privacy policy.