# PDF.co: use async=true and poll the job, sync calls time out on large documents

## TL;DR

Set `async: true` on every PDF.co call and poll the job, do not wait on the HTTP response. A sync call blocks until conversion finishes and times out on large or slow documents; the async call returns a job id immediately and you poll `/v1/job/check` with that id until the status is success, then download the result from the returned URL. Build your integration around the job lifecycle from the start: enqueue, poll with backoff, fetch result, handle the failure status.

Use this when you run into the situation in the title.

**When not to use this skill:** unrelated tasks. It covers only the procedure above.

## Compatibility

The steps above apply to the commands named in them. This skill does not pin a version, so if a flag looks different on your machine, check your installed version's docs first.

## Details

Retrofitting async after your first production timeout is much more painful than starting with it.

Context: Official docs/samples (PDF.co official samples repo, pdfdotco/pdf-co-api-samples on github.com): every PDF.co conversion endpoint takes an `async` flag. With async=true, the call returns a job id instead of blocking, and you poll the job/check endpoint for status until the result URL is ready. The samples default to async=true precisely because sync calls time out on large documents.
