Piloterr
Referencia de la APIInputs

Check an input's rows against a mapping

POST
/v1/inputs/{id}/check

Before a run: which rows a project of this endpoint and mapping would skip as invalid (not called, not billed), and why. A row is invalid when a required parameter is empty, a value is not one the parameter allows (enum in GET /v1/endpoints), or not of its type (number, integer, boolean). Runs apply the same rules. Nothing is stored and no credit is used.

What a run would cost: valid × the endpoint's credit_cost (GET /v1/endpoints), invalid rows being free, and at most the project's max_cost_per_run (plus one row, which a run may go over by). For an endpoint billed per row or per GB (billing_mode) that is the least it costs: a row's cost is only known from its answer. Starting the run checks the same against the workspace's credits (402 insufficient_credits, error.details.required and available).

Autorización

ApiKeyAuth
headerX-Api-Key<token>

Parámetros de ruta

id*string

The input's id, from POST /v1/inputs, POST /v1/inputs/list or POST /v1/inputs/uploads

Length1 <= length

Cuerpo de la solicitud

application/json
  1. body
endpoint_id*string

The endpoint the rows would call, from GET /v1/endpoints

Length1 <= length
mapping*

Per endpoint parameter, the input column it takes ({"column": …}) or a fixed value ({"value": …})

rate_percent?integer

The project's share of the rate limit, for the estimated duration

Range10 <= value <= 100
Default50

Cuerpo de la respuesta

The check

application/json
  1. response
total*integer
valid*integer

Rows a run would call: the ones billed, each at the endpoint's credit_cost (per row or per GB: at least), up to the project's max_cost_per_run

invalid*integer

Rows a run would skip as invalid: not called, not billed

reasons*array<>

Most frequent first; a row with two issues is in both

estimate*

How long a run over the valid rows takes, at least

Example Request
curl -X POST 'https://dataflow.piloterr.com/v1/inputs/string/check' \
  -H 'Content-Type: application/json' \
  -d '{
  "endpoint_id": "cm0p7x3da000a08l4gs5e2n1c",
  "mapping": {
    "query": {
      "column": "asin"
    },
    "domain": {
      "column": "marketplace"
    }
  },
  "rate_percent": 50
}'
Example Response
{
  "total": 3,
  "valid": 2,
  "invalid": 1,
  "reasons": [
    {
      "code": "required_empty",
      "param": "query",
      "message": "Missing required parameter",
      "count": 1,
      "rows": [
        3
      ]
    }
  ],
  "estimate": {
    "rate_per_second": 5,
    "duration_seconds": 1
  }
}