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:merchant_id used for billing, so no additional authentication is required.
Processing Flow
Call Processing Endpoint
Your frontend sends a POST request with the file URL and delegation token to any supported endpoint.
Usage Recording
Usage is recorded against the merchant’s ledger (from the JWT). See Usage & Billing.
Processing
The endpoint processes the extracted data (validation, classification, enrichment, etc.).
Discovering Available Endpoints
Use the route discovery endpoint to find all endpoints that support post-upload processing:Example: Species Name Validation
This example shows how to validate botanical names from an uploaded file.Request
Headers:| Header | Value | Description |
|---|---|---|
Authorization | Bearer <token> | The delegation token from /v1/auth/delegate-upload |
Content-Type | application/json | Required for JSON body |
| Field | Type | Required | Description |
|---|---|---|---|
file_url | string | Yes | The TUS upload URL returned after upload completes |
filename | string | No | Original filename for context |
Example Request
Example Response
Example: Pot Size Validation
This example shows how to classify pot sizes from an uploaded file.Request
Response
Error Responses
| Status | Error | Description |
|---|---|---|
400 | invalid_request | Missing file_url in request body |
401 | invalid_token | JWT token validation failed or expired |
403 | forbidden | Token doesn’t have access to the specified file |
404 | file_not_found | The specified file URL does not exist |
422 | parsing_failed | Could not extract data from file |
500 | processing_error | Processing service unavailable |
Token Reuse
The delegation token serves dual purposes:
- Upload authentication — Authorizes the TUS upload
- Processing authentication — Authorizes processing endpoints and identifies the merchant for billing
Best Practices
Call immediately after upload
Call immediately after upload
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.
Handle the response in your UI
Handle the response in your UI
Since the data is returned directly, you can display results to your users immediately without waiting for webhooks or polling.
Use route discovery
Use route discovery
Call
/v1/routes/from-upload to dynamically discover available processing endpoints and their capabilities, rather than hardcoding endpoint paths.Check accepted file types
Check accepted file types
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
Related Documentation
- Upload Delegation — How to obtain delegation tokens
- Usage & Billing — How usage is tracked and billed
- Route Discovery — Endpoint to discover available processing routes

