Skip to main content

Overview

After uploading a file via TUS, you can call any API endpoint that supports post-upload processing. The same delegation token used for the upload authenticates the processing request.
This endpoint pattern replaces the previous webhook-based flow. Your frontend now calls processing endpoints directly after upload, giving you immediate control over when processing occurs.

Authentication

Use the same delegation token that was used for the TUS upload:
The token contains the merchant_id used for billing, so no additional authentication is required.

Processing Flow

1

Upload Complete

After the TUS upload completes, your frontend receives the file URL.
2

Call Processing Endpoint

Your frontend sends a POST request with the file URL and delegation token to any supported endpoint.
3

Internal Fetch

The API fetches the file from storage using the provided URL.
4

Parsing

The parser extracts structured data from the uploaded file.
5

Usage Recording

Usage is recorded against the merchant’s ledger (from the JWT). See Usage & Billing.
6

Processing

The endpoint processes the extracted data (validation, classification, enrichment, etc.).
7

Response

Processed data and usage information are returned directly to your frontend.

Discovering Available Endpoints

Use the route discovery endpoint to find all endpoints that support post-upload processing:
Response:

Example: Species Name Validation

This example shows how to validate botanical names from an uploaded file.

Request

Headers: Request Body:

Example Request

Example Response

Example: Pot Size Validation

This example shows how to classify pot sizes from an uploaded file.

Request

Response

Error Responses

Token Reuse

The delegation token serves dual purposes:
  1. Upload authentication — Authorizes the TUS upload
  2. Processing authentication — Authorizes processing endpoints and identifies the merchant for billing
This design simplifies integration since you only need to manage one token per upload session.

Best Practices

For the best user experience, call the processing endpoint as soon as the TUS upload completes. The delegation token has a 5-minute expiration, so don’t delay processing.
Since the data is returned directly, you can display results to your users immediately without waiting for webhooks or polling.
Call /v1/routes/from-upload to dynamically discover available processing endpoints and their capabilities, rather than hardcoding endpoint paths.
Each endpoint specifies which file types it can process. Use the accepted_file_types field from route discovery to validate files before upload.

Complete Integration Example