Results

Results endpoint

Poll by jobId until fileStatus is terminal, then read the structured output.

Last updated: April 2026

Endpoint

HTTP
GET https://api.number7ai.com/api/v1/results/:jobId

Processing lifecycle

uploadingprocessingscanningai_processingdone|failed
Only done and failed are terminal states. Stop polling when you reach either.

Polling strategy

  • Poll every 20 seconds

    For most invoice documents, processing completes in under 90 seconds.

  • Time out after 2 minutes

    If still non-terminal after 6 polls, surface an error to the user and retry later.

  • Handle 404 gracefully

    404 means the jobId is not found for your account scope — check the ID was issued to the same key.

  • Retry 5xx with backoff

    Transient server errors should be retried with exponential backoff: 1s, 2s, 4s…

TypeScript
async function pollResult(jobId: string, apiKey: string) {
  const BASE = "https://api.number7ai.com/api/v1";
  const headers = { Authorization: `Bearer ${apiKey}` };

  for (let attempt = 0; attempt < 6; attempt++) {
    await new Promise((r) => setTimeout(r, 20_000));

    const res = await fetch(`${BASE}/results/${jobId}`, { headers });

    if (res.status === 404) throw new Error("Job not found");

    const body = await res.json();
    const status = body.data?.fileStatus;

    if (status === "done")   return body.data;
    if (status === "failed") throw new Error(`Processing failed: ${body.data?.error}`);
  }

  throw new Error("Timed out waiting for result");
}

Done response shape

JSON
{
  "success": true,
  "data": {
    "jobId": "job_abc123",
    "fileStatus": "done",
    "documentType": "invoice",
    "result": {
      "vendor":    { "name": "ABC Traders Pvt Ltd", "gstin": "27ABCDE1234F1Z5" },
      "invoiceNo": "INV-2026-001",
      "date":      "2026-04-15",
      "lineItems": [
        { "description": "Widget A", "qty": 10, "unitPrice": 500, "total": 5000 }
      ],
      "subtotal":  5000,
      "cgst":      450,
      "sgst":      450,
      "grandTotal":5900
    }
  }
}
Field names and nesting vary by document type. See the full schema in the upload docs.