Skip to main content

Extract API Reference

All Extract endpoints require authentication via API key (Authorization: Bearer YOUR_API_KEY).

Base URL: https://api.rynko.dev/api

Jobs

Create Extraction Job

POST /extract/jobs
Content-Type: multipart/form-data

Upload files and extract structured data using a schema or existing config.

Form Fields:

FieldTypeRequiredDescription
filesFile[]YesOne or more files to extract from
schemastring (JSON)ConditionalJSON Schema defining fields to extract. Required if no schemaId.
schemaIdstringConditionalID of an existing Extract config. Required if no schema.
gateIdstringNoFlow gate ID (uses gate's published schema)
instructionsstringNoAdditional instructions for the AI provider
conflictResolutionstringNoflag_conflicts (default), prefer_first_file, prefer_highest_confidence
providerstringNoAI provider override: google, anthropic, openai, openrouter

Response: 201 Created

{
"id": "uuid",
"shortId": "ejob_abc12345",
"status": "QUEUED",
"schemaSource": "custom",
"fileCount": 1,
"createdAt": "2026-03-25T10:00:00.000Z"
}

Get Extraction Job

GET /extract/jobs/:id

Returns the full job including result (when completed).

Response: 200 OK

{
"id": "uuid",
"shortId": "ejob_abc12345",
"status": "COMPLETED",
"schemaSource": "custom",
"fileCount": 1,
"result": {
"data": { "invoiceNumber": "INV-001", "total": 1250.00 },
"fields": [
{ "field": "invoiceNumber", "confidence": "HIGH", "score": 0.98 },
{ "field": "total", "confidence": "HIGH", "score": 0.99 }
]
},
"metadata": {
"provider": "google",
"model": "gemini-2.0-flash",
"tokensUsed": 1250,
"costEstimate": 0.002
},
"durationMs": 3200,
"createdAt": "2026-03-25T10:00:00.000Z",
"completedAt": "2026-03-25T10:00:03.200Z"
}

Job Statuses: QUEUED | PROCESSING | COMPLETED | FAILED | CANCELLED

List Extraction Jobs

GET /extract/jobs?status=COMPLETED&limit=20&offset=0

Query Parameters:

ParamTypeDescription
statusstringFilter by status
limitnumberMax results (default 20, max 100)
offsetnumberPagination offset

Cancel Extraction Job

DELETE /extract/jobs/:id

Cancels a queued or processing job.

Get Extract Usage

GET /extract/usage

Returns current extraction credit usage.

{
"used": 42,
"limit": 100,
"remaining": 58,
"isBeta": true
}

Discovery

Create Discovery Job

POST /extract/discover
Content-Type: multipart/form-data

Upload files without a schema — the AI discovers what fields exist.

Form Fields:

FieldTypeRequiredDescription
filesFile[]YesFiles to analyze
instructionsstringNoHints about what to look for
gateIdstringNoGate ID for reference extraction storage

Response: Same as Create Extraction Job. The result includes a discovered schema.

Extract Configs

Reusable extraction configurations with versioning.

Create Config

POST /extract/configs
Content-Type: application/json
{
"name": "Invoice Extractor",
"description": "Extracts standard invoice fields",
"schemaMode": "json",
"schema": {
"type": "object",
"properties": {
"invoiceNumber": { "type": "string" },
"total": { "type": "number" }
}
},
"provider": "google",
"instructions": "Focus on the header section for invoice metadata"
}

Get Config

GET /extract/configs/:id

List Configs

GET /extract/configs?status=active&limit=20

Update Config

PATCH /extract/configs/:id

Creates a draft version. Changes don't affect running jobs until published.

Publish Config

POST /extract/configs/:id/publish
{
"versionName": "v2",
"changeNotes": "Added line items field"
}

Get Version History

GET /extract/configs/:id/versions

Restore Version

POST /extract/configs/:id/versions/:versionId/restore

Creates a new draft from a historical version.

Run Config

POST /extract/configs/:id/run
Content-Type: multipart/form-data

Run extraction using a config's published version.

FieldTypeRequiredDescription
filesFile[]YesFiles to extract from
instructionsstringNoOverride instructions

Delete Config

DELETE /extract/configs/:id
warning

Gate-linked configs cannot be deleted directly. Disable Stage 0 on the gate first.

Gate Integration (Stage 0)

Enable Extract on Gate

PATCH /flow/gates/:gateId/extract/enable

Auto-creates a linked Extract config.

Disable Extract on Gate

PATCH /flow/gates/:gateId/extract/disable

Archives the linked Extract config (reversible).

Submit File Run

POST /flow/gates/:gateId/runs/file
Content-Type: multipart/form-data

Upload files for the full pipeline: Extract → Validate → Render → Approve → Deliver.

FieldTypeRequiredDescription
filesFile[]YesFiles to process
instructionsstringNoExtraction instructions

Error Codes

CodeHTTPDescription
ERR_EXTRACT_001400No files provided
ERR_EXTRACT_002400Invalid schema
ERR_EXTRACT_003400Unsupported file type
ERR_EXTRACT_004400File too large (max 100MB)
ERR_EXTRACT_005404Job not found
ERR_EXTRACT_006429Rate limited
ERR_EXTRACT_007402No extraction credits remaining
ERR_EXTRACT_008404Config not found
ERR_EXTRACT_009422Cannot delete gate-linked config
ERR_EXTRACT_010400Config has no published version