You can use this request to import contacts via an SFTP client.

The Method

RESTPOSThttps://[Your URL]/api/2.0/imports/sftp

Your method must be structured as follows:


You will need the following parameters before you can use this API request:

Property TypeDescriptionRequired
$credentialsstringThe credentials required to log into the SFTP server.yes
$mappingsarrayA list of mappings where the key is the field to map, and the value is the position of the field in the CSV file
E.g. Array(‘email’ => 0, ‘name’ => 2) (email will be the first column in the CSV and name will be the third column in the CSV)
$listIds arrayAn array of list IDs to import into.
E.g. Array(1, 2) will import into list 1 and 2 provided they exist.
$settingsarrayAn array of settings you need for the list.yes


When filling out the $credentials and $settings parameters, you will need the following properties:

Property TypeDescriptionDefaultRequiredRead Only
HostnamestringThe SFTP hostname to connect to.emptyyesyes
UsernamestringThe username to use when connecting to the SFTP host. emptyyesyes
PasswordstringThe password to use when connecting to the SFTP. emptyyesyes
PortstringThe SFTP port21yesyes
FilestringThe location of the file on the SFTP serveremptyyesyes
Property TypeDescriptionDefaultRequired
Update_duplicatesstringYes/No instruction on whether or not to update duplicates.yesyes
Update_usingstringThe ID to use when updating. Choose between: none / unique_id / system_id
(This field must be used together with custom_key_position)
Custom_key_positionstringPosition of custom key in file. emptyyes
DelimeterstringThe delimiter used to separate values in the import.
You can choose between ‘comma’, ‘semicolon’, ‘pipe’, ‘tab’.
Progress_email_addressstringEmail address to send the import report to.emptyyes

Code Samples


$request = new HttpRequest();

  'content-type' => 'application/json',
  'authorization' => 'Basic YWRtaW5pc3RyYXRvcjpqSVYxT=='

    "credentials": {
        "hostname": "",
        "username": "vagrant",
        "password": "vagrant",
        "post": "22",
        "file": "ftp_test.txt"
    "mappings": {
        "email": "1",
        "lastname": "2"
    "listIds": [1],
    "settings": {
        "update_duplicates": "yes",
        "delimiter": "comma"

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;