Mapping rules
How each row becomes the parameters of one call, and which rows a run skips before it starts.
-
A parameter maps to
{"column": "…"}or{"value": "…"}. Parameters you leave out are not sent. -
Every required parameter must be mapped, every column must be one of the input's, and every parameter one the endpoint takes. Dataflow checks the mapping against the endpoint and the input's columns when you create or update the project, and answers
422 mapping_invalidwith the problems inerror.details(Required parameter is not mapped,Column "…" is not in the input,Unknown parameter for this endpoint):{ "error": { "code": "mapping_invalid", "message": "The mapping does not fit the endpoint or the input", "details": [{ "param": "domain", "message": "Column \"site\" is not in the input" }] } } -
Values are trimmed. An empty value leaves the parameter out of that row's call, so an optional parameter stays unset.
-
A row that cannot be sent is not called and not billed: it gets the status
invalid, with the reason in its error. That is a required parameter left empty (Missing required parameter: …), a value the parameter does not allow (whenGET /v1/endpointslists itsenum:sort: Not one of asc, desc), or a value of another type for anumber,integerorbooleanparameter (limit: Not a number). Booleans readtrue,false,1or0, in any case. A parameter withis_arraytakes a comma list and is not checked value by value. -
Values are sent as text: in the query string for
GETendpoints, in the JSON body forPOSTendpoints. -
With a search input, the columns are the fields of the search results, plus
search_query: the search that found the row. Map it like any other column,{"column": "search_query"}.
Check the rows before a run
POST /v1/inputs/{id}/check tells, before any run, which rows of an uploaded file or list a mapping would skip as invalid, and why. Runs follow the same rules, so the rows it counts are the ones a run skips. Nothing is stored and no credit is used. A URL or search input has no stored rows to check: it is read again at every run.
curl https://dataflow.piloterr.com/v1/inputs/INPUT_ID/check \
-H "x-api-key: YOUR_API_KEY" -H "content-type: application/json" \
-d '{"endpoint_id": "ENDPOINT_ID", "mapping": {"domain": {"column": "website"}}, "rate_percent": 50}'{
"total": 1200,
"valid": 1185,
"invalid": 15,
"reasons": [
{ "code": "required_empty", "param": "domain", "message": "Missing required parameter", "count": 15, "rows": [4, 18, 77, 90, 132] }
],
"estimate": { "rate_per_second": 5, "duration_seconds": 237 }
}reasonscome most frequent first;rowsholds the first 5 row numbers, counted from 1. Codes:required_empty,not_allowed,not_a_number,not_an_integer,not_a_boolean. A row with two problems counts once ininvalidand appears under both reasons.estimateis the least a run over the valid rows takes atrate_percent(default50) of your plan's rate limit: slow answers and the polls of asynchronous endpoints add to it. Both fields arenullwhen the rate cannot be read.- A mapping that does not fit answers
422 mapping_invalid, as when creating a project; an endpoint you cannot run422 endpoint_not_eligible; an unknown input404 input_not_found.
The dashboard runs this check on the last step of a new project and shows the rows that will be skipped, the cost of the others and how long the run takes at least.
In the dashboard, a parameter is pre-mapped to the column with the same name, in any case, so naming your columns after the parameters saves a step.