Piloterr
API referenceInputs

Upload a big file straight to storage

POST
/v1/inputs/uploads

Returns a URL to PUT the file to, valid 15 minutes and only for exactly size bytes. Then call POST /v1/inputs/{id}/parse. CSV, TSV, TXT, XLSX, XLS, ODS, Numbers, JSON or NDJSON, up to 50 MB.

Authorization

ApiKeyAuth
headerX-Api-Key<token>

Header Parameters

Idempotency-Key?string

Any unique string of yours (a UUID), so that sending the request again does not create it twice: for 24 hours, the same request with the same key answers the first answer again, with the header Idempotent-Replayed: true. The key is the workspace's, per route and path; sent with another body or query, it is refused (422 idempotency_key_reused); while the first request still runs, 409 idempotency_key_in_progress. Answers 5xx, 409 and 429 are not kept: the same key can be sent again.

Match^[\x20-\x7e]{1,255}$

Request Body

application/json
  1. body
filename*string

The file's name; its extension tells how to read it

Length1 <= length <= 255
size*integer

In bytes

Range0 < value

Response Body

Where to send the file

application/json
  1. response
id*string
upload_url*string
method*"PUT"
Value in"PUT"
headers*
expires_in*integer

Seconds

Example Request
curl -X POST 'https://dataflow.piloterr.com/v1/inputs/uploads' \
  -H 'Content-Type: application/json' \
  -d '{
  "filename": "asins.xlsx",
  "size": 104857
}'
Example Response
{
  "id": "3f6b1c9e-5d0a-4c7e-9a51-2b8e0f4d7a13",
  "upload_url": "https://storage.example.com/dataflow/source?X-Amz-Signature=example",
  "method": "PUT",
  "headers": {
    "Content-Length": "104857"
  },
  "expires_in": 900
}