Extract quickstart
One document from upload to structured fields.
Reserve a job and get an upload URL
Shell curl -X POST 'https://api.dev.oprag.ai/v1/extract/upload-urls' \ -H 'X-Oprag-Key: sk_live_...' \ -H 'Content-Type: application/json' \ -d '{"filename":"invoice.pdf","contentType":"application/pdf","schemaId":"invoice"}'The response carries
jobId,uploadUrl,uploadFields, andpollUrl. Pass"auto"asschemaIdto have the document classified for you.POST the file to S3
Shell # Every field from uploadFields, then the file, as multipart/form-data. curl -X POST "$UPLOAD_URL" \ -F key="$KEY" -F policy="$POLICY" -F x-amz-signature="$SIGNATURE" \ -F file=@invoice.pdfGoing straight to S3 is what allows a 100 MB PDF; the API's own body limit is far smaller. Size limits are enforced by the presigned POST itself.
Confirm
Shell curl -X POST 'https://api.dev.oprag.ai/v1/extract/jobs/ext_a1b2c3d4e5f6789012345678abcdef01/confirm' \ -H 'X-Oprag-Key: sk_live_...'Confirm checks the object exists, is non-empty, is within the size limit, and has both a supported MIME type and matching magic bytes — then queues it. It is idempotent while the job is queued.
Poll
Shell curl 'https://api.dev.oprag.ai/v1/extract/jobs/ext_a1b2c3d4e5f6789012345678abcdef01' \ -H 'X-Oprag-Key: sk_live_...'Poll until
statusis terminal. Large PDFs report progress along the way withphase,totalPages, and a chunk count.
Ready to ship?
Get started free