Imports — bulk load CSV

Get a template (column hints)

curl -s "https://api.live-direct-marketing.online/api/import/templates" -H "Authorization: Bearer $LDM_KEY"

Upload CSV → start import

Two-step: upload via /api/files/upload to get fileId, then start with the chosen entity and column-mapping.

# 1. upload
FID=$(curl -s -X POST "https://api.live-direct-marketing.online/api/files/upload" \
  -H "Authorization: Bearer $LDM_KEY" -F "file=@/tmp/companies.csv" | jq -r '.id')

# 2. create import job
curl -s -X POST "https://api.live-direct-marketing.online/api/import/tasks" \
  -H "Authorization: Bearer $LDM_KEY" -H "Content-Type: application/json" \
  -d "{\"entity\":\"companies\",\"fileId\":\"$FID\",\"mapping\":{\"Name\":\"name\",\"Domain\":\"domain\"}}"

Poll status / cancel

curl -s "https://api.live-direct-marketing.online/api/import/tasks/$JOB_ID"        -H "Authorization: Bearer $LDM_KEY"
curl -s -X POST "https://api.live-direct-marketing.online/api/import/tasks/$JOB_ID/cancel" -H "Authorization: Bearer $LDM_KEY"