Imports

Upload Leads Csv

Upload a CSV: detect encoding and delimiter, suggest a column mapping, preview 20 rows. Nothing is imported until `POST /imports/{id}/commit`.

API key access

Needs the leads:write scope with an API key (ro_pat_...). A signed-in session uses the caller's role.
POST/api/v1/imports/leads
AuthorizationBearer <token>

Access token from /api/v1/auth/login, or an API key (ro_pat_..., RO-176) from /api/v1/workspaces/current/api-keys: the key implies its workspace and needs the route's scope. MCP connectors (/api/v1/mcp only) may use an OAuth access token (ro_oat_..., RO-284).

In: header

Header Parameters

X-Workspace-Id?string | null

Id of the workspace to act on (must be a member).

filestring

CSV file, at most 10 MB and 20,000 rows

Response Body

curl -X POST "http://localhost:8000/api/v1/imports/leads" \  -H "X-Workspace-Id: string" \  -F file="string"
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "filename": "string",
  "status": "previewed",
  "encoding": "string",
  "delimiter": "string",
  "headers": [
    "string"
  ],
  "total_rows": 0,
  "created_count": 0,
  "updated_count": 0,
  "skipped_count": 0,
  "error_count": 0,
  "suppressed_count": 0,
  "mapping": [
    {
      "property1": null,
      "property2": null
    }
  ],
  "options": {
    "property1": null,
    "property2": null
  },
  "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",
  "created_at": "2019-08-24T14:15:22Z",
  "started_at": "2019-08-24T14:15:22Z",
  "completed_at": "2019-08-24T14:15:22Z",
  "suggested_mapping": [
    {
      "column": 0,
      "header": "string",
      "field": {},
      "custom_key": "string"
    }
  ],
  "sample_rows": [
    {
      "row": 0,
      "cells": [
        "string"
      ]
    }
  ],
  "default_country": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}