PilotFoxDocs

Upload an import

POST
/api/v1/sites/{siteId}/imports

Uploads a file to import as multipart/form-data: first the source field (umami: an Umami CSV export; plausible: Plausible's CSV export ZIP; simple_analytics: a Simple Analytics raw CSV export; native_jsonl: a PilotFox NDJSON export), then the file (2 GiB at most). The file is stored and imported in the background: 202 with the import, whose status its GET follows. 409 while the organization has too many imports queued or running, 429 while it has too many uploads streaming; 413 past the size limit, 415 for another body type; 503 when busy or when storage or background jobs are unavailable.

Requires imports:write on the site (an API key, or a signed-in member's role). Share links: 401.

Authorization

headerx-api-key<token>

An organization API key (ak_…), with the permissions and the sites it was created with. For servers and scripts: no cookie and no Origin check. Also accepted as Authorization: Bearer ak_… (apiKeyBearer). A request carries one credential: a key sent with a share token or a live session cookie is 400 (details.reason: ambiguous_credentials).

Scope: imports:write

Path Parameters

siteId*string

Response Body

Accepted

application/json
  1. response
data*
Example Request
curl -X POST 'https://pilotfox.app/api/v1/sites/string/imports'
Example Response202
{  "data": {    "id": "string",    "source": "umami",    "status": "uploaded",    "fileName": "string",    "fileBytes": 0,    "rowsRead": 0,    "rowsImported": 0,    "rowsSkipped": 0,    "rowsInvalid": 0,    "approximate": true,    "error": "string",    "createdAt": "string",    "startedAt": "string",    "finishedAt": "string"  }}