ExDocApi/ Docs

GET /api/v1/jobs/:id/result

Fetch the extracted data for a completed job.

Requires authentication.


Endpoint

GET /api/v1/jobs/:job_id/result
Authorization: Bearer <api_key>
curl "https://exdocapi.cheapehai.shop/api/v1/jobs/a1b2c3d4-.../result" \
  -H "Authorization: Bearer $EXDOC_API_KEY"

Response — 200 OK

{
  "job_id": "a1b2c3d4-...",
  "result": {
    "invoice_number": "INV-2024-0042",
    "vendor_name":    "Acme Supplies Ltd.",
    "total":          "18,450.00",
    "date":           "2024-11-10",
    "due_date":       null
  }
}

The result object contains exactly the keys you specified in the fields of your extraction request. Fields not found in the document are null.


Error responses

| Status | Body | Cause | |--------|------|-------| | 401 | Invalid API key | Bad or missing key | | 404 | Job not found | Wrong ID or different account | | 409 | Job not complete | Job is still processing — poll status first |

409 response body

{
  "error": "Job not complete",
  "status": "processing"
}

Recommended pattern

Always check job status before fetching the result:

// 1. Poll until done
const job = await waitForJob(jobId, apiKey)

// 2. Fetch result
const res = await fetch(`https://exdocapi.cheapehai.shop/api/v1/jobs/${jobId}/result`, {
  headers: { Authorization: `Bearer ${apiKey}` }
})
const { result } = await res.json()
← PreviousGET /jobs/:idNext →GET /usage