Leads

Import leads from an uploaded CSV or Excel file

Imports the CSV or Excel file uploaded to a createBulkUploadUrl URL into that upload's campaign. An Excel workbook must have exactly one visible sheet with data. Returns a job right away; poll getAsyncImportJob. The server parses the file, maps headers to lead fields (every other column becomes a custom field keyed by its header, so completed_sentence merges as {{custom.completed_sentence}}), and drops rows with a missing or invalid email, repeats of an earlier row's email, and block-listed emails. input.file_report on the job lists the mapping and each dropped row with its spreadsheet row number. Calling this again for the same upload returns the same job. enrolled counts every address started on this import, including an address already in this campaign. updated is how many of those had their details refreshed, including a later copy of the same email in the same request. created is a new lead row. imported is the same number as enrolled. This call does not check other campaigns.

POST/v1/uploads/{id}/import

Authorization

bearerAuth
AuthorizationBearer <token>

Use an account API key in the Authorization header: Authorization: Bearer f_....

In: header

Path Parameters

idstring

upload_id returned by createBulkUploadUrl.

Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

column_mapping?object

CSV header -> lead field (for example email, company_name), custom.<key> for a custom field, or ignore to skip the column.

[key: string]?string
verification_options?object

Same as verification_options on createStagedLeadImport.

[key: string]?any
curl -X POST "https://example.com/v1/uploads/497f6eca-6276-4993-bfeb-53cbbbba6f08/import" \  -H "Content-Type: application/json" \  -d '{}'
{  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "account_id": "449e7a5c-69d3-4b8a-aaaf-5c9b713ebc65",    "campaign_id": "78614b6c-fe7c-41e2-8e25-c9b3a3c91904",    "created_by_api_key_id": "16a8c1ea-aaaf-49f0-9266-c657c48ceff3",    "status": "uploading",    "progress": 0,    "cursor": 0,    "input": {      "operation": "api_lead_import",      "global_lead_ids": [        "string"      ],      "saved_list_id": "66dbf949-b2e8-4ab0-88f6-7819d41ad41e",      "source_campaign_id": "2640cdba-4b3e-4560-9225-0360dc4a4884",      "target_list_id": "e020bfe9-7c71-4403-800b-700dad22bfd2",      "upload_id": "f2ef591b-135b-46fa-a604-3d4fda5bfbfb",      "list_id": "430bbdbc-9d7f-4d06-a273-67ca4ba4ae4b",      "leads": [        {          "email": "user@example.com",          "name": "string",          "first_name": "string",          "last_name": "string",          "company_name": "string",          "website": "string",          "linkedin_url": "string",          "company_linkedin_url": "string",          "phone_number": "string",          "mobile_phone_number": "string",          "custom_lead_data": {},          "tags": [            "string"          ],          "email_verification": {            "status": "ok",            "quality": "string",            "provider": "string",            "verified_at": "2019-08-24T14:15:22Z",            "is_free": true,            "is_role": true          }        }      ],      "total_count": 0,      "source": "string",      "exclusions": {        "list_id": "430bbdbc-9d7f-4d06-a273-67ca4ba4ae4b",        "campaign_id": "78614b6c-fe7c-41e2-8e25-c9b3a3c91904",        "global_lead_ids": [          "string"        ],        "emails": [          "user@example.com"        ]      },      "preview_id": "string",      "expected_count": 0,      "projection": "full",      "query": {},      "column_layout": [        {}      ],      "filename_base": "string"    },    "result": {      "created": 0,      "updated": 0,      "enrolled": 0,      "excluded": 0,      "skipped": 0,      "incomplete": 0,      "failed": 0,      "paused": 0,      "resumed": 0,      "removed": 0,      "added": 0,      "rows_exported": 0,      "imported": 0,      "errors": [        {          "globalLeadId": "string",          "index": 0,          "message": "string"        }      ]    },    "errors": [      {        "globalLeadId": "string",        "index": 0,        "message": "string"      }    ],    "cancel_requested_at": "2019-08-24T14:15:22Z",    "started_at": "2019-08-24T14:15:22Z",    "completed_at": "2019-08-24T14:15:22Z",    "created_at": "2019-08-24T14:15:22Z",    "updated_at": "2019-08-24T14:15:22Z"  }}
{  "error": {    "type": "invalid_request_error",    "code": "invalid_flow",    "message": "Flow validation failed"  },  "details": [    {      "path": "nodes[1].data.variants[0].id",      "code": "invalid_variant_id",      "message": "Email variants must have a stable UUID id."    }  ]}
{  "error": {    "type": "authentication_error",    "code": "invalid_api_key",    "message": "A valid Furnace API key is required"  }}
{  "error": {    "type": "permission_error",    "code": "smartlead_read_only",    "message": "Smartlead campaigns are read-only via the API"  }}
{  "error": {    "type": "invalid_request_error",    "code": "campaign_not_found",    "message": "Campaign not found"  }}
{  "error": {    "type": "rate_limit_error",    "code": "rate_limit_exceeded",    "message": "Rate limit exceeded for this account"  }}
{  "error": {    "type": "api_error",    "code": "internal_error",    "message": "Internal server error"  }}