API REFERENCE
Process private data
On this page
/api/ingestionSubmit a versioned import, read private artifacts, browse organization datasets, or explicitly deliver one ready output. Standard authenticated MCP uses the same operations. Delegated OAuth excludes this tool.
Authentication
x-api-key in header
bearerAuth bearer
Request
curl --request POST \
--url 'https://api.recoupable.dev/api/ingestion' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"action": "create",
"idempotency_key": "inventory-2026-12-v1",
"source": {
"kind": "inline",
"format": "csv",
"filename": "inventory.csv",
"content_base64": "U0tVLFF0eQowMDEsMgowMDIsMwo="
},
"contract": {
"version": "inventory-1",
"fields": [
{
"name": "sku",
"source": "SKU",
"type": "string"
},
{
"name": "quantity",
"source": "Qty",
"type": "integer"
}
],
"business_keys": [
"sku"
],
"controls": [
{
"field": "quantity",
"expected": "5"
}
]
}
}'Try it
Fill in the fields, send the request from your browser, and read the live response. The curl below updates as you type.
Kept in this browser tab only and cleared when it closes.
curl --request POST \
--url 'https://api.recoupable.dev/api/ingestion' \
--header 'Content-Type: application/json' \
--data '{
"action": "create",
"idempotency_key": "inventory-2026-12-v1",
"source": {
"kind": "inline",
"format": "csv",
"filename": "inventory.csv",
"content_base64": "U0tVLFF0eQowMDEsMgowMDIsMwo="
},
"contract": {
"version": "inventory-1",
"fields": [
{
"name": "sku",
"source": "SKU",
"type": "string"
},
{
"name": "quantity",
"source": "Qty",
"type": "integer"
}
],
"business_keys": [
"sku"
],
"controls": [
{
"field": "quantity",
"expected": "5"
}
]
}
}'Request body required
application/json
oneOf · Create 1
Describes an admitted job. The worker checks source compatibility after submission. Workbook mode requires an XLSX source and the PDF reader requires text_table. An incompatible source can receive a job ID and then a rejected result.
actionstring · constrequiredFixed value: "create"
organization_idstringformat: uuid
dataset_idstringformat: uuid
idempotency_keystringrequiredminLength: 1 · maxLength: 128 · pattern: ^[A-Za-z0-9._:-]+$
sourceone ofrequiredProperties for source
oneOf · object 1
kindstring · constrequiredFixed value: "inline"
filenamestringrequiredminLength: 1 · maxLength: 200
formatstring · enumrequiredValues: "csv", "tsv", "json", "jsonl", "xlsx", "pdf"
content_base64stringrequiredminLength: 4 · maxLength: 2796204
oneOf · object 2
kindstring · constrequiredFixed value: "connector"
connector_idstringrequiredminLength: 1 · maxLength: 128 · pattern: ^[A-Za-z0-9._:-]+$
contractobjectrequiredVersioned mapping contract. Keys, filters, and sums reference declared output fields. Preserve IDs as strings and exact amounts as decimal strings.
Properties for contract
versionstringrequiredminLength: 1 · maxLength: 100
fieldsarray<Field>requiredminItems: 1 · maxItems: 100
Item properties for fields
namestringrequiredpattern: ^[a-z][a-z0-9_]{0,62}$
typestring · enumrequiredValues: "string", "integer", "decimal", "date", "boolean"
sourcestringminLength: 1 · maxLength: 200
constantstringmaxLength: 2000
nullablebooleantrimbooleandecimal_separatorstring · enumValues: ".", ","
thousands_separatorstring · enumValues: "", ",", ".", " "
oneOf · any 1
Required: source
oneOf · any 2
Required: constant
allOf · any 1
any
allOf · any 2
any
business_keysarray<string>maxItems: 20
Item properties for business_keys
string
ignored_columnsarray<string>maxItems: 100
Item properties for ignored_columns
string
controlsarray<TotalCheck>maxItems: 100
Item properties for controls
fieldstringrequiredpattern: ^[a-z][a-z0-9_]{0,62}$
expectedstringrequiredmaxLength: 100 · pattern: ^[+-]?\d+(?:\.\d+)?$
whereobjecttolerancestringmaxLength: 100 · pattern: ^\+?\d+(?:\.\d+)?$
aggregateobjectProperties for aggregate
group_byarray<string>requiredmaxItems: 20
Item properties for group_by
string
sumsarray<string>requiredminItems: 1 · maxItems: 20
Item properties for sums
string
header_rowintegerminimum: 1 · maximum: 1000
sheetstringminLength: 1 · maxLength: 200
workbookobjectWorkbook package mode for XLSX. Assign each actual sheet an explicit role, with at least one data sheet. Use either this option or sheet.
Properties for workbook
sheetsarray<WorkbookSheet>requiredThe engine checks unique sheet names and enforces a combined maximum of 100 inline and cell-based checks across the contract.
minItems: 1 · maxItems: 100
Item properties for sheets
oneOf · object 1
Map physical headings on this sheet to the common input headings used by the fields.
namestringrequiredminLength: 1 · maxLength: 200
rolestring · constrequiredFixed value: "data"
header_rowintegerminimum: 1 · maximum: 1000
columnsobjectoneOf · object 2
namestringrequiredminLength: 1 · maxLength: 200
rolestring · constrequiredFixed value: "control"
checksarray<CellCheck>requiredminItems: 1 · maxItems: 100
Item properties for checks
cellstringrequiredA literal workbook cell address within the first 100 columns (A through CV) and rows 1 through 1048576.
pattern: ^(?:[A-Z]|[AB][A-Z]|C[A-V])(?:[1-9][0-9]{0,5}|10(?:[0-3][0-9]{4}|4(?:[0-7][0-9]{3}|8(?:[0-4][0-9]{2}|5(?:[0-6][0-9]|7[0-6])))))$
fieldstringrequiredpattern: ^[a-z][a-z0-9_]{0,62}$
whereobjecttolerancestringmaxLength: 100 · pattern: ^\+?\d+(?:\.\d+)?$
oneOf · object 3
namestringrequiredminLength: 1 · maxLength: 200
rolestring · constrequiredFixed value: "ignore"
reasonstringrequiredminLength: 1 · maxLength: 200
records_patharray<string>maxItems: 10
Item properties for records_path
string
delimiterstring · enumValues: ",", ";", "\t", "|"
text_tableobjectProperties for text_table
review_refstringrequiredminLength: 1 · maxLength: 200
separatorstringrequiredminLength: 1 · maxLength: 10
allOf · any 1
any
oneOf · Read 2
actionstring · constrequiredFixed value: "read"
organization_idstringformat: uuid
job_idstringrequiredpattern: ^[a-f0-9]{64}$
oneOf · Artifact 3
actionstring · constrequiredFixed value: "artifact"
organization_idstringformat: uuid
job_idstringrequiredpattern: ^[a-f0-9]{64}$
stagestring · enumrequiredValues: "bronze", "silver", "gold"
oneOf · Deliver 4
actionstring · constrequiredFixed value: "deliver"
organization_idstringformat: uuid
job_idstringrequiredpattern: ^[a-f0-9]{64}$
destination_idstringrequiredminLength: 1 · maxLength: 128 · pattern: ^[A-Za-z0-9._:-]+$
gold_sha256stringrequiredpattern: ^[a-f0-9]{64}$
oneOf · Datasets 5
actionstring · constrequiredFixed value: "datasets"
organization_idstringrequiredformat: uuid
limitintegerminimum: 1 · maximum: 50
afterstringformat: uuid
oneOf · Imports 6
actionstring · constrequiredFixed value: "imports"
organization_idstringrequiredformat: uuid
dataset_idstringrequiredformat: uuid
limitintegerminimum: 1 · maximum: 50
afterstringpattern: ^[a-f0-9]{64}$
oneOf · Records 7
actionstring · constrequiredFixed value: "records"
organization_idstringrequiredformat: uuid
dataset_idstringrequiredformat: uuid
job_idstringrequiredpattern: ^[a-f0-9]{64}$
limitintegerminimum: 1 · maximum: 100
after_rowintegerminimum: 0 · maximum: 10000
{
"action": "create",
"idempotency_key": "inventory-2026-12-v1",
"source": {
"kind": "inline",
"format": "csv",
"filename": "inventory.csv",
"content_base64": "U0tVLFF0eQowMDEsMgowMDIsMwo="
},
"contract": {
"version": "inventory-1",
"fields": [
{
"name": "sku",
"source": "SKU",
"type": "string"
},
{
"name": "quantity",
"source": "Qty",
"type": "integer"
}
],
"business_keys": [
"sku"
],
"controls": [
{
"field": "quantity",
"expected": "5"
}
]
}
}Responses
200The selected read, catalog query or delivery completed.+
application/json
oneOf · Job 1
job_idstringrequiredpattern: ^[a-f0-9]{64}$
dataset_idstringformat: uuid
statusstring · enumrequiredValues: "queued", "held", "ready", "rejected"
engine_versionstringsource_sha256stringpattern: ^[a-f0-9]{64}$
contract_sha256stringSHA-256 of the validated, canonical contract including defaults. Version 2 workbook completion receipts include this field.
pattern: ^[a-f0-9]{64}$
silver_sha256stringpattern: ^[a-f0-9]{64}$
gold_sha256string | nullpattern: ^[a-f0-9]{64}$
issue_countintegerissues_truncatedintegerissuesarray<object>Item properties for issues
codestringrequiredrowintegerfieldstringsource_sheetstringcontrolsarray<object>Item properties for controls
fieldstringrequiredexpectedstringrequiredactualstringrequiredpassedbooleanrequiredsource_sheetstringsource_cellstringrows_readintegerrows_outputintegerallOf · any 1
any
oneOf · ArtifactResult 2
job_idstringrequiredpattern: ^[a-f0-9]{64}$
stagestring · enumrequiredValues: "bronze", "silver", "gold"
artifactobjectrequiredBronze contains filename, format, source_sha256, and content_base64. Silver contains source-grain records. Gold contains the ready records and field types.
oneOf · CatalogPage 3
oneOf · object 1
datasetsarray<object>requiredItem properties for datasets
object
next_afterstring | nullrequiredoneOf · object 2
importsarray<object>requiredItem properties for imports
object
next_afterstring | nullrequiredoneOf · object 3
recordsarray<object>requiredItem properties for records
object
next_afterinteger | nullrequiredoneOf · DeliveryResult 4
job_idstringrequiredpattern: ^[a-f0-9]{64}$
delivery_idstringrequiredpattern: ^[a-f0-9]{64}$
receiptobjectrequiredProperties for receipt
committedboolean · constrequiredFixed value: true
rowsintegerrequired202Create accepted. An identical replay can return an already completed result.+
application/json
job_idstringrequiredpattern: ^[a-f0-9]{64}$
dataset_idstringformat: uuid
statusstring · enumrequiredValues: "queued", "held", "ready", "rejected"
engine_versionstringsource_sha256stringpattern: ^[a-f0-9]{64}$
contract_sha256stringSHA-256 of the validated, canonical contract including defaults. Version 2 workbook completion receipts include this field.
pattern: ^[a-f0-9]{64}$
silver_sha256stringpattern: ^[a-f0-9]{64}$
gold_sha256string | nullpattern: ^[a-f0-9]{64}$
issue_countintegerissues_truncatedintegerissuesarray<object>Item properties for issues
codestringrequiredrowintegerfieldstringsource_sheetstringcontrolsarray<object>Item properties for controls
fieldstringrequiredexpectedstringrequiredactualstringrequiredpassedbooleanrequiredsource_sheetstringsource_cellstringrows_readintegerrows_outputintegerallOf · any 1
any
400Invalid input, query, or source encoding.+
application/json
errorstringrequired401A valid credential is required.+
application/json
errorstringrequired403Access to the selected scope was denied.+
application/json
errorstringrequired404The scoped job or artifact could not be found.+
application/json
errorstringrequired409The selected version, idempotency key, or artifact conflicts with stored state.+
application/json
errorstringrequired413The request, source, or record exceeds its size limit.+
application/json
errorstringrequired429The caller reached the operation rate limit.+
application/json
errorstringrequired503The operation or its configured infrastructure is unavailable.+
application/json
errorstringrequiredFull specification
Download the OpenAPI file for complete schemas, constraints, and examples.
Download ingestion.jsonView operation source
{
"summary": "Process private data",
"operationId": "operateIngestion",
"description": "Submit a versioned import, read private artifacts, browse organization datasets, or explicitly deliver one ready output. Standard authenticated MCP uses the same operations. Delegated OAuth excludes this tool.",
"security": [
{
"apiKeyAuth": []
},
{
"bearerAuth": []
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/Create"
},
{
"$ref": "#/components/schemas/Read"
},
{
"$ref": "#/components/schemas/Artifact"
},
{
"$ref": "#/components/schemas/Deliver"
},
{
"$ref": "#/components/schemas/Datasets"
},
{
"$ref": "#/components/schemas/Imports"
},
{
"$ref": "#/components/schemas/Records"
}
]
},
"example": {
"action": "create",
"idempotency_key": "inventory-2026-12-v1",
"source": {
"kind": "inline",
"format": "csv",
"filename": "inventory.csv",
"content_base64": "U0tVLFF0eQowMDEsMgowMDIsMwo="
},
"contract": {
"version": "inventory-1",
"fields": [
{
"name": "sku",
"source": "SKU",
"type": "string"
},
{
"name": "quantity",
"source": "Qty",
"type": "integer"
}
],
"business_keys": [
"sku"
],
"controls": [
{
"field": "quantity",
"expected": "5"
}
]
}
}
}
}
},
"responses": {
"200": {
"description": "The selected read, catalog query or delivery completed.",
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/Job"
},
{
"$ref": "#/components/schemas/ArtifactResult"
},
{
"$ref": "#/components/schemas/CatalogPage"
},
{
"$ref": "#/components/schemas/DeliveryResult"
}
]
}
}
}
},
"202": {
"description": "Create accepted. An identical replay can return an already completed result.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Job"
}
}
}
},
"400": {
"description": "Invalid input, query, or source encoding.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "A valid credential is required.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "Access to the selected scope was denied.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "The scoped job or artifact could not be found.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"409": {
"description": "The selected version, idempotency key, or artifact conflicts with stored state.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"413": {
"description": "The request, source, or record exceeds its size limit.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "The caller reached the operation rate limit.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"503": {
"description": "The operation or its configured infrastructure is unavailable.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}Submit an import
Supply original bytes as base64 or name a source connector configured for your scope. Give the transformation contract a version. Declare the fields to map, types, business keys and any independent checks. The request example imports two inventory rows. It preserves SKU 001 as text and checks that the two quantities sum to five.
Create returns HTTP 202 with a job ID. Repeating the same request with the same idempotency key recovers its existing job. Use a new key for different bytes or mapping rules. Private source bytes are limited to 2 MiB, JSON request bodies to 3 MiB, and data to 10,000 rows and 100 columns.
CSV, TSV, JSON and JSONL accept explicit mappings. XLSX supports sheet selection. Native-text PDFs need a reviewed text layout and its literal separator. Read the resulting issues to identify files that need a different layout or exceed a reader’s limits.
Account for a whole workbook
The workbook option assigns every sheet its own role. Data sheets may rename headings into the common field vocabulary. Control sheets supply independently reported totals. Document the reason for ignoring an instructions sheet. This example checks a workbook whose East and West warehouses both contribute to the quantity in Summary cell B2.
{
"version": "warehouse-inventory-1",
"fields": [
{ "name": "sku", "source": "SKU", "type": "string" },
{ "name": "quantity", "source": "Qty", "type": "integer" }
],
"workbook": {
"sheets": [
{ "name": "East", "role": "data", "columns": { "Units shipped": "Qty" } },
{ "name": "West", "role": "data" },
{ "name": "Summary", "role": "control", "checks": [{ "cell": "B2", "field": "quantity" }] },
{ "name": "Instructions", "role": "ignore", "reason": "Operator instructions only" }
]
}
}Use workbook mode with an XLSX source. A single-sheet contract can continue selecting one worksheet by name. Use a literal numeric total for each control. A formula cell requires review. If a control filters by a unit or currency, it checks only the rows that match. Declare a check for every population whose total you need to verify. An import with an unresolved control difference has no deliverable output.
Review and deliver
The read action returns the job state. ready means the declared checks passed. Choose controls appropriate to the business decision. A correct sum alone cannot verify the account or the underlying metric. Download large artifacts over authenticated HTTP.
Deliver a ready job by passing the configured destination_id, job_id and the exact gold_sha256 you reviewed. A destination write and its receipt commit together. For organization jobs pass the same organization_id on every action. Authorized members can browse the organization’s versioned datasets and records through read an ingestion result.