Analyze a previously uploaded invoice document
const url = 'https://api.invogi.com/v1/invoices/from-upload';const options = { method: 'POST', headers: { Prefer: 'respond-async', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"upload_id":"example","purchase_order_ref":"example","company_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","compliance_check_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.invogi.com/v1/invoices/from-upload \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'Prefer: respond-async' \ --data '{ "upload_id": "example", "purchase_order_ref": "example", "company_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "compliance_check_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'Analyzes synchronously by default. Send Prefer: respond-async to request background analysis; when honored the response is UploadAnalysisQueued with Preference-Applied: respond-async, and progress is read from GET /uploads/{uploadId}/status.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”For a Clerk session, selects a workspace in which the user has an active membership. If omitted, the remembered accessible workspace is used. API keys remain bound to their own workspace and cannot select another tenant.
Example
respond-asyncRFC 7240 preference. respond-async opts into queued analysis.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Defaults to the default company
The id of a compliance check of this same file. When the check ran in the last 24 hours, in the same billing period, on identical bytes, its usage is released once this upload is counted, so the two count as one invoice. An upload credits at most one check. Otherwise ignored.
Example generated
{ "upload_id": "example", "purchase_order_ref": "example", "company_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "compliance_check_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}Responses
Section titled “Responses”Analysis result, or queued when Prefer: respond-async was honored
object
object
Example
{ "status": "COMPLETE", "decision": "PASS"}Headers
Section titled “Headers”Present with respond-async only when the analysis was queued.
Invalid request
Missing or invalid API key
API key lacks required scope/role
Resource not found
Conflicting idempotency key or resource processing state
Request-rate or customer-usage limit exceeded; inspect the stable error code