A project's input
See what a project runs over, preview a URL or search input, and replace the input.
GET /v1/projects/{id}/input shows what a project runs over: the file name or list with its columns, row_count, read_at (when it was parsed or saved), its first 20 rows (sample), how it read (stats: empty, duplicate and unreadable rows), its sheets and its size in bytes (null for a list). For a URL, it shows the url with its headers masked; for a search, the search (endpoint_id, queries, params, pages). Both have row_count and read_at from the latest run that read them (null before the first one), and no columns, sample or stats: those change at every read.
{
"type": "file",
"input_id": "4f1c2a9e-…",
"filename": "companies.xlsx",
"url": null,
"headers": {},
"search": null,
"columns": ["company", "website"],
"row_count": 18432,
"read_at": "2026-11-21T10:00:00.000Z",
"available": true,
"sample": [{ "company": "Stripe", "website": "stripe.com" }],
"stats": { "empty_rows": 2, "duplicate_rows": 0, "deduplicated": false, "row_error_count": 0, "row_errors": [] },
"sheets": ["Companies", "Notes"],
"size": 912384
}available is false once the file or list was deleted: runs then fail to start (409 input_missing) until you replace it. stats is null for a URL, a search, and a file or list that was deleted.
A URL is read again at every run, so its rows are not kept. POST /v1/projects/{id}/input/preview reads it now, with its stored headers, and returns what it holds (the same summary as an upload, with its first 20 rows and an empty id). Nothing is stored and no credit is used. For a search, it runs the first page of the first search now, with the project's API key: one call of the search endpoint, billed as usual (402 insufficient_credits with error.details.stage: "search" when your workspace is out of credits). For a file or a list, the answer is 409 input_not_remote: the first rows are already in GET /v1/projects/{id}/input.
To replace the input, send another one with PATCH /v1/projects/{id}: a new file or list ({"type": "file", "input_id": "…"}), a URL or a search. The mapping is checked against the new columns (a URL is read once for that, a search runs its first page), and the update is refused (422 mapping_invalid) when a mapped column is missing: send the fixed mapping in the same request. An input_id that is not one of your inputs is refused with 422 validation_failed, error.details[0].path being input.input_id. Past runs, and a run in progress, keep the rows they froze.