.zip, and Leaf inspects it, routes each kind of content to the service that processes it, and reports the result under a single uploadId. You no longer need to know ahead of time whether a customer’s archive contains monitor files, boundary shapefiles, or a mix.
Behind the scenes, detected content is fanned out to the same pipelines documented elsewhere:
For conceptual background on preparing archives, see Uploading Files and Uploading Boundaries.
Base URL
Endpoints
Archive requirements
- The file must be a
.zip. Gzip archives (.gz,.tar.gz) are rejected with400 Bad Request, and so is any.zipthat contains a.gzentry anywhere inside it, even alongside valid machine or boundary files. Remove or decompress.gzentries before zipping. macOS Finder sidecars (__MACOSX/,._*) are ignored. - Maximum size is 3 GB.
- Keep the original folder structure from the monitor or export tool. The same folder structure rules that apply to batch uploads apply here.
- A single archive may mix content types. See How content is routed for what Leaf detects and in what order.
How content is routed
Leaf inspects the archive once and decides which downstream services receive it:- Machine data is sent to the batch upload service first, unless the archive is boundary-only (field geometry present and no machine content). If this hand-off fails, the upload ends in
ROUTING_FAILEDand no further routing happens. - Field geometry is then sent to the field boundary upload service as a best-effort second route. A failure here is recorded on its own artifact and does not affect the machine-data batch.
- A
.geojson,.json(other thanmetadata.json), or.kmlfile. - A complete polygon shapefile:
.shpwith its.shxand.dbfcompanions at the same path, a polygon shape type, and at most 100 features.
.shx/.dbf are treated as machine data and stay on the batch upload path. .kmz is not detected by this endpoint; upload KMZ boundaries directly through Field boundary upload. Leaf looks inside nested ZIPs up to two levels deep. Field geometry detection is skipped, and the upload stays on the machine-data path only, when the archive expands to more than 1 GiB uncompressed, or to more than 256 MiB at a ratio above 10:1.
Soil-sampling shapefiles are not sent to field boundary upload, even when they match the polygon-shapefile checks above.
Upload statuses
status reports where the upload is in the intake and processing lifecycle.
RECEIVED and DISPATCHED are in-progress states. ROUTING_FAILED is a terminal intake failure that does not set completedTimestamp. The remaining five are terminal and populate completedTimestamp.
Upload a file
POST/uploads
Uploads a .zip archive on behalf of a Leaf user. The request returns 202 Accepted immediately; detection and routing happen asynchronously. Use Get an upload to track progress.
Parameters
Send the request asmultipart/form-data.
Request
Response
202 Accepted
Errors
Get an upload
GET/uploads/{uploadId}
Returns the current status of an upload, what Leaf detected inside the archive, and where each part was routed. Uploads are scoped to the API owner that created them: an unknown ID and an ID owned by another account both return 404 Not Found.
Parameters
Request
Response
The response may include additional fields (for example
packagingStatus and outputReady) that support features not covered on this page. Ignore fields not documented here; they are not part of the public contract.Alerts
Instead of polling, you can subscribe to alerts for the upload lifecycle:
Both payloads carry
uploadId, leafUserId, type, timestamp, and status. Branch on payload.status, not only on the event type: inboxUploadProcessingFinished with status: PARTIALLY_COMPLETED means part of the upload failed, and on accounts without output generation enabled you will only ever receive inboxUploadProcessingFailed (see the warning under Upload statuses). Use the alert as a “processing has stopped” signal and read the per-file result from the downstream IDs in artifacts[].
No alert fires for ROUTING_FAILED. If you have not received either event within roughly 6 hours of upload, poll Get an upload as a backstop.
These two events are subscribed by name through the Alerts API like any other event, but they are not yet listed on the Events catalog page.

