Skip to main content
POST
/
v1
/
import
/
contacts
Import Contacts
curl --request POST \
  --url https://api.example.com/v1/import/contacts \
  --header 'Content-Type: application/json' \
  --data '
{
  "rows": [
    {}
  ],
  "csv": "<string>",
  "has_header": true,
  "mapping": {},
  "update_existing": true,
  "tags": [
    {}
  ]
}
'
{
  "data": {
    "job_id": "<string>",
    "status": "<string>",
    "created_count": 123,
    "updated_count": 123,
    "skipped_count": 123,
    "errors": [
      {}
    ]
  }
}

Request

Supply either a structured rows array or a raw csv string. When CSV is provided, supply a mapping that maps CSV column names to contact fields. Imports are processed synchronously for up to 500 rows; larger imports are queued and can be tracked via the returned job_id.

Headers

Authorization: Bearer wbk_your_api_key_here
Content-Type: application/json
Idempotency-Key
string
Strongly recommended for imports. Same key returns the original result (including job_id) within 24 hours.

Body Parameters

rows
array
Array of contact objects. Each object accepts the same fields as POST /v1/contacts. Provide either rows or csv.
csv
string
Raw CSV text. First line is treated as headers unless has_header is false. Provide either rows or csv.
has_header
boolean
default:"true"
Applies only to CSV imports.
mapping
object
CSV-only. Maps CSV header names to contact field names (e.g. { "Email Address": "email", "Full Name": "full_name" }). Unknown columns are ignored.
update_existing
boolean
default:"false"
When true, rows with matching email or phone are updated; when false, they are skipped.
tags
array
Optional array of tag strings applied to every imported row.

Response

data
object
Responses include X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, and X-Request-ID. Large imports emit an import.completed webhook event when done.
curl -X POST \
  https://data.leadlex.com/functions/v1/api-gateway/v1/import/contacts \
  -H "Authorization: Bearer wbk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "rows": [
      { "full_name": "Jane Doe", "email": "jane@acme.com" },
      { "full_name": "Bob Smith", "email": "bob@beta.com" }
    ]
  }'

Example Response

{
  "data": {
    "job_id": "imp_01HY1",
    "status": "completed",
    "created_count": 2,
    "updated_count": 0,
    "skipped_count": 0,
    "errors": []
  }
}

Errors

StatusCodeDescription
400validation_errorNeither rows nor csv provided, or mapping is malformed
401invalid_keyInvalid or expired API key
403insufficient_permissionsMissing write:contacts permission
413payload_too_largePayload exceeds 20 MB
429rate_limitedRate limit exceeded