CodeBaobab
API debugging

Recover a failed document export

Problem

A customer’s nightly export sends invoice PDFs to its archive. The service created the export, but the client never received the response. On retry, the client got an export ID and later tried to download an expired link. Walk through the requests the client should make to finish this run without creating a duplicate export.

What you know

  • The original POST /exports used the key invoices-2026-04-30. The same key and request body return the same export ID. The retry returned export-42.
  • GET /exports/export-42 reports ready. The download request returned 403 with the code link_expired. The export itself is still available.
  • POST /exports/export-42/download-link issues a new link for the existing export. A throttled request returns 429 with Retry-After.

Checking exercise access…