## TL;DR
Evidence uploads are heavy API traffic: many files, large sizes, all at the end of a run when patience is thin. A single-shot export that hits a limit loses everything and retries as a bigger burst. Chunk the export into per-file or small-batch uploads with pacing, record which items the case system accepted, and resume from the first unaccepted item. The case should show partial progress honestly rather than an all-or-nothing failure.

```text
api rate limit hit mid-evidence-upload and the agent's case export failed
```

## Use this when
- Exports fail near the end with rate limit errors and nothing is saved in the case.
- Re-running the export duplicates some evidence and still fails.

## Not for this skill when
- The case system rejects a specific file type. Chunking will not fix a format rule.
- The rate limit is a hard daily quota already spent. Resume tomorrow or raise the quota through the account owner.

## Steps
1. Log which upload request hits the limit and how many items were accepted before it. Verify: partial progress is measurable from the case system side.
2. Split the export into per-item uploads with the case system idempotency or naming that prevents duplicates on retry. Verify: a repeated item does not duplicate in the case.
3. Pace uploads under the API limit and honour its retry guidance on limit responses. Verify: a test export of full size completes without limit errors.
4. Persist export state: item, status and case reference, so a stopped export resumes at the first pending item. Verify: killing an export mid-way and resuming loses and duplicates nothing.
5. Run the full campaign evidence export. Verify: the case contains every item exactly once, with the export log attached.

## Variant phrasings
### rate limit evidence upload case export failed resume
The resumable export variant.
### chunked upload api limit agent case files
The chunking variant.

Compatibility: Case management and ticketing APIs with attachment endpoints and rate limits.

## Why it happens
Export is the least engineered step in many agents because it happens last and demos well on three files. At campaign scale it is a bulk transfer problem with the same physics as any other: limits, partial failure and duplicates, all needing explicit design.

## Edge cases / pitfalls
- Attach the export manifest to the case first, so even a partial upload is interpretable by the analyst.
- Compress or reference very large artefacts rather than pushing them through an API never meant for them.
- Report partial exports as partial in the run summary. Silent partial success corrupts case evidence.

## Provenance

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