Create enrichment
/enrichmentsCreate an enrichment without running it: the task prompt the row agent reads for every row, the output columns it fills, and optionally input_columns (the headers rows must carry; empty = any), a budget in credits per row (default 1.5 per output column; it then moves by 1.5 as columns are added or removed until budget_locked is true), and the tools (only_tools replaces the default set, additional_tools adds to it; names from GET /tools). Each output entry is a column name or { "name", "prompt"?, "output_schema"?, "tool"? }; output_schema is a JSON Schema for the cell value (see help → output_schema); without one, the column is typed from the prompts as the one value it is about (email, URL, date, year, count, money, percentage, phone, address, a person's or company's name, ...; only prose stays free text); tool pins a tool to the column — "tool": "linkedin_person_profile", the ColumnToolPin: the agent makes one call of it per row, with arguments it works out from the row and its research, and the call's result is the cell. Output names may not repeat an input column.
From a prompt alone. Leave output out and the recipe is written from the prompt: one output column per fact it asks to find about each row, each with its own prompt and type, plus the name and input_columns when you give none ("Research each company: its CEO, employee count, latest funding round date and amount, and whether it is hiring" → CEO, Employee count, Latest funding round date, Latest funding round amount, Hiring, typed). The response shows what was written; adjust it with PATCH /enrichments/{id}. A prompt that names no facts to find is refused (422): add output.
The enrichment comes with the dataset it fills: an empty dataset bound to it, named after it, whose input columns are input_columns (one Input column when you give none; the first build names it, or rename it with PATCH /datasets/{id}). It is on the Datasets page of the app at once. The response is the enrichment plus dataset_id (its id) and app_url (the dataset in the app).
Then add rows to the dataset — POST /datasets/{id}/rows, rows/import for a CSV, or rows/build to generate them — and fill it with POST /enrich (dataset_id): the rows and cells are kept and the dataset shows them. Or run the enrichment once on rows you send inline (enrichment_id + input), nothing kept. Editing the enrichment through its dataset (the app's Column tab, PATCH /datasets/{id}) rebinds the dataset to a private copy; PATCH /enrichments/{id} edits this enrichment itself.
{ "dataset_id": "ds_..." } alone answers the dataset's own enrichment as { id, name, app_url, dataset_id } (nothing is created; 422 while the dataset has no output columns — PATCH /datasets/{id} adds them).
Request bodyrequired
dataset_idstringAlone: a dataset's id (ds_...); answers its own enrichment. Not with the fields below.
namestringRecipe: display name
promptstringRecipe: the task prompt the row agent reads for every row. Required without dataset_id.
input_columnsarray of stringRecipe: the headers rows must carry, the dataset's input columns. Omit for any (one Input column), or, without output, for the ones the prompt implies.
outputarray of OutputColumnSpecRecipe: the columns to fill; a plain string is a name whose type is inferred. Omit it and the columns are written from the prompt, one per fact it asks for, each typed.
Attributes
namestringrequiredThe column name; the handle in every later call
promptstringWhat to find for this column, one value, on top of the enrichment's task prompt; on a pinned column, what to call the tool on. Leave sources out; the agent records the URLs it cited on the cell's sources.
output_schemaobjectA JSON Schema for the cell value (help with output_schema). Leave it out: the type is inferred from the prompt, caveats included. Send one only for an enum, a list, or an object. Does not apply to a pinned column.
A tool name from GET /tools. The row agent makes one call of it per row — arguments it works out from the row, the known values, and its research; the column prompt says what to call it on — and the call's result is the cell. null unpins. help with pinned_columns.
budgetnumberRecipe: credits the row agent may spend per row. Default 1.5 per output column.
budget_lockedbooleanRecipe: true keeps the budget as set when output columns are later added or removed; false lets it move by 1.5 per column.
only_toolsarray of stringRecipe: exactly these tools (GET /tools). Replaces the default set.
additional_toolsarray of stringRecipe: the default tools plus these (GET /tools; some need enabling on the account or a linked key).
Responses
201Save a recipe — the saved enrichment plus dataset_id and app_url, the dataset it fills. With dataset_id alone — the dataset's own enrichment as { id, name, app_url, dataset_id }
Save a recipe
idstringenr_...
namestringnullablepromptstringThe task prompt the row agent reads for every row
input_columnsarray of stringThe headers rows must carry (empty = any)
outputarray of OutputColumnSpecAttributes
namestringrequiredThe column name; the handle in every later call
promptstringWhat to find for this column, one value, on top of the enrichment's task prompt; on a pinned column, what to call the tool on. Leave sources out; the agent records the URLs it cited on the cell's
sources.output_schemaobjectA JSON Schema for the cell value (
helpwithoutput_schema). Leave it out: the type is inferred from the prompt, caveats included. Send one only for an enum, a list, or an object. Does not apply to a pinned column.A tool name from GET /tools. The row agent makes one call of it per row — arguments it works out from the row, the known values, and its research; the column
promptsays what to call it on — and the call's result is the cell.nullunpins.helpwithpinned_columns.toolsarray of stringThe tools the row agent may call (names from GET /tools)
budget_credits_per_rownumberThe most the row agent may spend on one row. Moves by 1.5 per output column added or removed unless
budget_lockedbudget_lockedbooleantrue when the budget stays as set through column changes
versionintegerGoes up by one on every column change; a cell filled under an older version reads
stalecreated_atstring date-timeupdated_atstring date-timedataset_idstringThe dataset created for the enrichment (ds_...); add rows to it and fill it
app_urlstring uriThe dataset in the app
A dataset's own enrichment
idstringThe dataset's enrichment (enr_...)
namestringapp_urlstring uriThe dataset in the app
dataset_idstring
400The request is malformed or names a conflicting parameter combination
errorobjectrequiredAttributes
typestringrequiredMachine-readable error type (bad_request, not_found, forbidden, feature_not_enabled, duplicate_run_key, insufficient_credits, credit_cap_exceeded, validation, not_implemented, ...)
messagestringrequiredHuman-readable explanation
detailsanyOptional extra context (e.g. per-field validation errors)
credit_detailCreditDetailThe estimate made at kickoff next to what has been charged so far. estimate is null for runs
started before estimates existed. Estimates and credit errors add credits_remaining and sufficient_credits.
Attributes
estimateone ofrequiredAttributes
CreditEstimate model →
minimumnumberrequiredLeast the run can cost
expectednumberLikely cost from past runs of the same config; absent without history
typicalobjectRecent p25–p75 settled range for builds of this size; absent without a dataset build estimate
Attributes
lownumberrequiredhighnumberrequiredmaximumnumberrequiredMost the run can cost
upfrontnumberCredits taken at kickoff when charged_upfront is true; 0 when the charge accrues as work completes
charged_upfrontbooleanrequiredtrue when a deposit is taken at kickoff (dataset builds, extractions); false when credits accrue as work completes
- null
credits_usednumberrequiredCredits charged so far (same value as the top-level credits_used)
credits_remainingnumberAccount balance. Only on estimates and credit errors.
sufficient_creditsbooleanWhether the balance covers estimate.maximum. Only on estimates and credit errors.
401Missing or invalid API key (request_status body — see the AuthError schema)
request_statusstringmessagestringerror_typestring403The API key's account may not access this resource or endpoint (forbidden), or the account has not migrated to Datasets yet (feature_not_enabled — open Datasets in the app and click "Migrate to Datasets")
errorobjectrequiredAttributes
typestringrequiredMachine-readable error type (bad_request, not_found, forbidden, feature_not_enabled, duplicate_run_key, insufficient_credits, credit_cap_exceeded, validation, not_implemented, ...)
messagestringrequiredHuman-readable explanation
detailsanyOptional extra context (e.g. per-field validation errors)
credit_detailCreditDetailThe estimate made at kickoff next to what has been charged so far. estimate is null for runs
started before estimates existed. Estimates and credit errors add credits_remaining and sufficient_credits.
Attributes
estimateone ofrequiredAttributes
CreditEstimate model →
minimumnumberrequiredLeast the run can cost
expectednumberLikely cost from past runs of the same config; absent without history
typicalobjectRecent p25–p75 settled range for builds of this size; absent without a dataset build estimate
Attributes
lownumberrequiredhighnumberrequiredmaximumnumberrequiredMost the run can cost
upfrontnumberCredits taken at kickoff when charged_upfront is true; 0 when the charge accrues as work completes
charged_upfrontbooleanrequiredtrue when a deposit is taken at kickoff (dataset builds, extractions); false when credits accrue as work completes
- null
credits_usednumberrequiredCredits charged so far (same value as the top-level credits_used)
credits_remainingnumberAccount balance. Only on estimates and credit errors.
sufficient_creditsbooleanWhether the balance covers estimate.maximum. Only on estimates and credit errors.
404No resource with that id on this account
errorobjectrequiredAttributes
typestringrequiredMachine-readable error type (bad_request, not_found, forbidden, feature_not_enabled, duplicate_run_key, insufficient_credits, credit_cap_exceeded, validation, not_implemented, ...)
messagestringrequiredHuman-readable explanation
detailsanyOptional extra context (e.g. per-field validation errors)
credit_detailCreditDetailThe estimate made at kickoff next to what has been charged so far. estimate is null for runs
started before estimates existed. Estimates and credit errors add credits_remaining and sufficient_credits.
Attributes
estimateone ofrequiredAttributes
CreditEstimate model →
minimumnumberrequiredLeast the run can cost
expectednumberLikely cost from past runs of the same config; absent without history
typicalobjectRecent p25–p75 settled range for builds of this size; absent without a dataset build estimate
Attributes
lownumberrequiredhighnumberrequiredmaximumnumberrequiredMost the run can cost
upfrontnumberCredits taken at kickoff when charged_upfront is true; 0 when the charge accrues as work completes
charged_upfrontbooleanrequiredtrue when a deposit is taken at kickoff (dataset builds, extractions); false when credits accrue as work completes
- null
credits_usednumberrequiredCredits charged so far (same value as the top-level credits_used)
credits_remainingnumberAccount balance. Only on estimates and credit errors.
sufficient_creditsbooleanWhether the balance covers estimate.maximum. Only on estimates and credit errors.
422The request is valid but can't be executed (e.g. insufficient_credits, credit_cap_exceeded when max_credits is set, validation failure)
errorobjectrequiredAttributes
typestringrequiredMachine-readable error type (bad_request, not_found, forbidden, feature_not_enabled, duplicate_run_key, insufficient_credits, credit_cap_exceeded, validation, not_implemented, ...)
messagestringrequiredHuman-readable explanation
detailsanyOptional extra context (e.g. per-field validation errors)
credit_detailCreditDetailThe estimate made at kickoff next to what has been charged so far. estimate is null for runs
started before estimates existed. Estimates and credit errors add credits_remaining and sufficient_credits.
Attributes
estimateone ofrequiredAttributes
CreditEstimate model →
minimumnumberrequiredLeast the run can cost
expectednumberLikely cost from past runs of the same config; absent without history
typicalobjectRecent p25–p75 settled range for builds of this size; absent without a dataset build estimate
Attributes
lownumberrequiredhighnumberrequiredmaximumnumberrequiredMost the run can cost
upfrontnumberCredits taken at kickoff when charged_upfront is true; 0 when the charge accrues as work completes
charged_upfrontbooleanrequiredtrue when a deposit is taken at kickoff (dataset builds, extractions); false when credits accrue as work completes
- null
credits_usednumberrequiredCredits charged so far (same value as the top-level credits_used)
credits_remainingnumberAccount balance. Only on estimates and credit errors.
sufficient_creditsbooleanWhether the balance covers estimate.maximum. Only on estimates and credit errors.