Skip to content
Help
Go to Learnient(opens in a new tab)

Syncing people from a CSV file

A CSV HR connection keeps your people in step with an HR or payroll system that has no connection of its own but can export a CSV file of employees. Each new file starts a sync, exactly like any other HR connection: people are added, their details kept up to date, and leavers given their leaving date. The first sync is held as a preview, so nothing changes until you choose Approve.

There are two ways for the file to reach Learnient:

  • CSV file over SFTP: your system saves the file to a folder on an SFTP server, and Learnient collects it from there
  • CSV file through the API: your system sends each file to the Learnient Public API

Some HR systems are listed under their own name and work the same way, with their columns already chosen for you (see Columns chosen by the HR system’s connector).

Both arrive without anyone uploading them. To add or update people from a spreadsheet you export and upload yourself, choose Upload file on CSV upload, under Other ways to import people on the Integrations page: it opens the people import.

Getting the CSV HR connection switched on for your account

Section titled “Getting the CSV HR connection switched on for your account”

CSV file over SFTP appears under Other ways to import people on the Integrations page only once Learnient has switched it on for your account. If you can’t see it in the list, contact support. CSV file through the API isn’t offered on the Integrations page: if your own system needs to send files through the API, contact support.

You need the Create integration permission to connect one, and Update integration to change its settings, map its columns or approve a held sync.

  1. Choose Admin, then Integrations in the left-hand menu and Integrations.
  2. Under Other ways to import people, choose Set up on CSV file over SFTP. The Connect CSV file over SFTP panel opens over the page.
  3. Fill in your SFTP server’s Server address (without https:// or a path), its Port (usually 22), and the Username Learnient signs in as.
  4. Choose how Learnient signs in, under Sign in with:
    • A key Learnient generates (the default, and safer): no password is needed
    • A password: enter the SFTP user’s Password
  5. Enter the Folder your system saves the file to, starting with /.
  6. Check the File name pattern (see Which file a CSV HR connection over SFTP collects). *.csv takes any CSV file in the folder.
  7. Optionally, enter an Archive folder. Learnient moves each file there once a sync has applied it.
  8. Check how the file is laid out: Column separator, Character encoding and Header row (see How Learnient reads your CSV file).
  9. Choose Connect.

Under a field is where to find its value or the form it takes. Where a field only needs explaining, such as Username, Sign in with, Column separator and Character encoding, the explanation is behind the info icon beside its name.

With A password, Learnient tests the connection straight away. With A key Learnient generates, the connection waits for you to add its key to your server first: its status stays Pending until you choose Test connection.

Adding Learnient’s public key to your SFTP server

Section titled “Adding Learnient’s public key to your SFTP server”

When a CSV HR connection signs in with A key Learnient generates, the connect panel goes on to show the SFTP key: Learnient’s Public key, with a button to copy it. The private key that goes with it never leaves Learnient. The public key is safe to share with whoever runs your SFTP server.

  1. Copy the Public key.
  2. Add it to the authorized_keys file of the SFTP user you entered under Username, or ask whoever runs your SFTP server to.
  3. Choose Test connection in the same panel. Learnient signs in and reads the folder. Nobody is synced by a test.
  4. Choose Done. The HR connection opens on its Overview.

If you close the panel before adding the key, test later with Test connection in the connection’s More actions (⋮).

You can find the key again at any time under Credentials on the connection’s Settings tab. If a connection signing in with a generated key has no key yet, No key yet is shown there with Generate key.

Regenerating the SFTP key for a CSV HR connection

Section titled “Regenerating the SFTP key for a CSV HR connection”

Regenerate the key if you think the server or its authorized_keys file has been exposed, or when your SFTP server is rebuilt.

  1. Open the HR connection and its Settings tab.
  2. Under Credentials, in the SFTP key section, choose Regenerate key.
  3. Regenerate the SFTP key? confirms first. Confirm it.
  4. Copy the new Public key into the SFTP user’s authorized_keys file before the next sync, and remove the old one.

The current key stops working straight away. Until the new public key is on your server, Learnient can’t sign in and nothing syncs.

To switch between a key and a password later, choose Change under Sign in with in Credentials, pick the other one in the window and choose Save. Switching to a key makes one for you.

When your SFTP server’s identity key changes

Section titled “When your SFTP server’s identity key changes”

The first time Learnient connects to your SFTP server successfully, it remembers the server’s identity key (its host key). Every later connection checks that the server shows the same key before Learnient signs in, so your files and the sign-in are never sent to a different server pretending to be yours.

If the key ever changes, Learnient doesn’t connect. The sync fails with “The SFTP server’s identity key changed, so Learnient didn’t connect”, and you’re notified.

  1. Check with whoever runs your SFTP server whether the server was replaced or rebuilt. If nobody changed it, treat the warning as a security problem and don’t go further until they’ve found out why.
  2. If the server really was replaced, open the connection’s Settings tab and, under Credentials, choose Change under Server address and choose Save in the window with the address as it is, even if it’s the same. Changing the Port does the same.
  3. Choose Test connection. Learnient remembers the new server’s key.

Your own system can send the file over the internet instead of saving it to an SFTP server. This kind of HR connection isn’t offered on the Integrations page, so contact support to set one up. One your organisation already has keeps working, and is under Connected with your other HR connections:

  1. Choose Manage on its card under Connected, then open its Files tab. Send files through the API shows the HR connection ID, with a button to copy it.
  2. Give the HR connection ID and an API key to whoever sets up your system’s side.

Your system sends each file to POST /v1/integrations/{connection}/files on the Learnient Public API, with the HR connection ID in place of {connection}. The API key needs the integrations:write scope. Each file must be a .csv or .txt file of no more than 20 MB. The details are in the Integration section of the Public API documentation.

A CSV HR connection through the API never syncs on a schedule. It syncs each time a file arrives.

Which file a CSV HR connection over SFTP collects

Section titled “Which file a CSV HR connection over SFTP collects”

A CSV HR connection over SFTP looks in its Folder for files whose names match the File name pattern. In the pattern, * stands for any text and ? for any one character. {YYYY}, {MM} and {DD} stand for today’s date in your account’s time zone, or yesterday’s, so a file written just before midnight is still collected after it. Matching ignores capitals.

For example, employees_{YYYY}{MM}{DD}*.csv matches employees_20261020.csv and Employees_20261020_0200.CSV on 20 October.

  • Only the newest file is used. When several match, Learnient takes the newest, and an older file is never applied after a newer one.
  • A file still being written is left alone. A file that changed in the last two minutes is collected at the next check.
  • The file is moved after it’s applied. If you set an Archive folder, the file moves there once its sync has applied it.

A CSV HR connection over SFTP checks your folder on its Schedule: every day at about 02:00 by default, and at most once an hour. Change it under Schedule on the connection’s Settings tab, by choosing How often and a time, such as Every weekday at 06:00 (see Changing when an HR connection syncs). A new file found at a check starts a sync.

  • Sync now checks the folder straight away and syncs the newest file.
  • Preview sync works out what the newest file already received would change, and changes nothing. It doesn’t check the folder.

A CSV HR connection through the API syncs when each file arrives. Sync now and Preview sync read the newest file it has received.

In History, a sync started by a file shows File received as how it started, and its run detail names the File it read.

What a new CSV HR connection’s Overview tells you

Section titled “What a new CSV HR connection’s Overview tells you”

A new CSV HR connection needs a first file and its columns mapped before it can sync. Until its first sync, its Overview says which step it’s waiting for, with a button to where you take it:

On the OverviewWhat to do
Waiting for the first fileThrough the API: your system sends the file with the connection’s ID, which HR connection ID takes you to on the Files tab. Over SFTP: Learnient collects the file from your folder on the connection’s Schedule; Credentials opens the folder and sign-in details on the Settings tab. Either way, the file’s column headings are what you map next
Map the file’s columnsA file has arrived. Choose Map the columns to open Columns on the Mapping tab, map at least Employee ID and Email, and choose Save changes. The file that’s waiting then syncs on its own within five minutes
No sync has run yetThe columns are mapped and a file is waiting: its sync starts on its own within five minutes

The first sync is held for you to Approve or Discard, unless you’ve switched off Hold the first sync for approval. Where the connector chose the columns for you, Waiting for the first file says the sync starts as soon as the file arrives.

Sync now and Preview sync stay unavailable until the Employee ID and Email columns are mapped, and, through the API, until a first file has arrived; hover over either to see why. The Overview suggests them only once they’re available.

A CSV file has no fixed layout, so you tell Learnient which column holds what. Do this on the connection’s Mapping tab, under Columns, once a first file has arrived: the columns offered are the headings from the newest file received, each with an example from its first row.

  1. For each Learnient field, choose the column that fills it, then Use this column. The fields are two to a row. Employee ID and Email are required. The info icon beside Employee ID, Known as, Mobile number and Manager’s works ID says what each one needs.
  2. Map the others your file has: First name, Known as, Last name, Works ID, Mobile number, HRIS ID, Job title, Department, Location, Company, Manager’s works ID, Start date, Leaving date and Employment status. Leave a field as Not in the file when your file doesn’t have it.
  3. For Start date and Leaving date, choose the Date format your file uses, such as 31/12/2026 (day/month/year). An empty cell means no date, and so do N/A, n/a, NA, na, -, None, none, NULL and null, with or without spaces around them. Any other value that isn’t a date in that format can’t be read, and that person’s row fails.
  1. For Employment status, list the Values meaning employed and the Values meaning left, separated by commas, for example Current, Active.
  2. Under Sample, choose Fetch sample to read a few rows of the newest file. Each person is listed by name, with who they are In Learnient (or New person) and the value each mapped field gives them, in Learnient’s words: dates as dates, and Employment status as Employed, Left or Not given. A field that couldn’t be read shows Couldn’t be read, with the reason beside it. The person is still listed by name with the values that did read, and In Learnient says Not synced until the fields below are fixed: a sync lists them as Failed, by name, and changes nothing about them. Nothing is saved or synced.
  1. Choose Save changes at the top of the page.

Employee ID must be unique to each person and never reused: it is how Learnient knows a row is the same person at every sync. Manager’s works ID is each person’s manager, by their works ID.

Mobile number is read the way it is for any HR connection: a number without a country code is from your organisation’s country, a number that isn’t a valid mobile or already belongs to someone else is left out with the reason, and it never opts anyone in to WhatsApp messages. See Mapping a mobile number from your HR system.

You can leave Employment status unmapped. Learnient then treats people whose leaving date has passed as left.

Before a first file has arrived there are no columns to offer, and Columns shows Waiting for the first file with how it arrives. A column that isn’t offered can still be used: type its heading exactly, or # and its position, such as #3 for the third column. A column with no heading, or a heading used twice, is offered by its position.

Columns chosen by the HR system’s connector

Section titled “Columns chosen by the HR system’s connector”

Some HR systems are offered under their own name and send a CSV file in a layout Learnient already knows. For those, the columns come already chosen, with their date formats and the values that mean employed or left, so the HR connection is ready to sync as soon as it’s connected. On the Mapping tab, under Columns:

  • each field filled by the connector says From the connector under it
  • change any column your file names differently. Your choice is used instead, and says Your choice under it. Choose Not in the file to leave a field out
  • choose Reset to the connector’s columns to put every column back as the connector chose it, then Save changes

Where a connector reads a date in a format the Date format list doesn’t name, the format is shown as 31 December 2026 written that way, such as 31.12.2026.

A CSV file that arrives before the columns are mapped

Section titled “A CSV file that arrives before the columns are mapped”

A file can arrive before you’ve mapped the columns: in fact the first file is what gives you the columns to choose from. It waits, showing Waiting on the Files tab, and its sync starts within five minutes of you saving the mapping with Save changes. As for every HR connection, that first sync is held as a preview for you to Approve or Discard (see The first sync is held for you to approve).

  • Column separator: the character between columns: Comma (,), Semicolon (;), Tab or Vertical bar (|)
  • Character encoding: UTF-8, Windows-1252 (Western European) or ISO-8859-1 (Latin-1). If accented names look wrong in Fetch sample, try another. A UTF-8 file that starts with a byte order mark is always read as UTF-8.
  • Header row: the row holding the column headings, usually 1. Rows above it are ignored

Blank rows are skipped. Values can be in double quotes, which lets a value contain the separator or a line break.

The Files tab of a CSV HR connection lists every file received, newest first. Each row shows the File name, when it was Received, its Status (with the reason under it when a file was rejected or is waiting), How it arrived (Collected over SFTP or Uploaded through the API), its Size and how many Rows it had. Rows is counted when the file’s sync reads it, so it stays blank while the file is waiting for its columns to be mapped. Choose the arrow at the end of a row to open the sync the file started. Search by file name, and use Sort by Received to show the newest or the oldest first.

StatusWhat it means
WaitingReceived, and its sync hasn’t finished yet. Under it, why: its sync starts once its columns are mapped on the Mapping tab, once the HR connection is turned on, when the current sync finishes, once the held sync is approved or discarded, or within five minutes; or its own sync is held for you to approve. While its sync runs, it shows Waiting with nothing under it
ProcessedIts sync applied it
RejectedNot applied: its sync failed or was discarded. The reason is under the status; open the sync for more
ArchivedApplied and moved to your Archive folder

Before any file has arrived, the tab says No files yet.

The same CSV file sent twice is synced once

Section titled “The same CSV file sent twice is synced once”

Learnient recognises a file by its contents, not its name. A file identical to one already received is ignored, whatever it’s called: over SFTP it’s skipped, and through the API it’s refused with “This file has already been received, so it wasn’t synced again”. To apply the same file again after changing the mapping, choose Sync now or Preview sync, which read the newest file again.

When a CSV file is incomplete, too old, too large or missing

Section titled “When a CSV file is incomplete, too old, too large or missing”

Learnient never applies part of a file. A file with any of these problems fails its sync, or holds it, and you’re notified. The reason shows on the sync in History:

ReasonWhat happenedWhat to do
The file arrived incompleteThe file ends part-way through a row, usually because it was copied before your system finished writing it. Nothing was appliedHave your system write the file under a temporary name and rename it when it’s finished, or write it to another folder and move it in
The file is too largeThe file is over 20 MB, or has more than 100,000 rows. Through the API, a file over 20 MB is refused when it is sent, so no sync startsSplit the export, or leave out people who don’t need Learnient
The file couldn’t be readIt isn’t a text file, or doesn’t fit the Character encoding chosenCheck the export settings and the Character encoding
The newest file is too oldOver SFTP, the newest file was last changed more than 36 hours ago, when a newer one was expected. It isn’t applied on its ownCheck your system’s export. To apply that file anyway, choose Sync now
No new file arrivedOver SFTP, no new file has arrived for 36 hours. You’re told once, not at every checkCheck your system’s export and that it saves to the Folder

When the columns in a new file no longer match your mapping, for example because a heading was renamed, most rows fail and the sync is held with “Too many records from the HR system couldn’t be read”. Choose Discard, fix the mapping on the Mapping tab, then choose Sync now. See Why an HR sync is held.

Learnient keeps each file it receives for 90 days, then deletes it. The syncs it started, and what they changed, stay in History. Your own copies, and the files in your Archive folder, are yours to keep or delete.

Can I upload a CSV file of my people myself?

Section titled “Can I upload a CSV file of my people myself?”

Not to an HR connection: a CSV HR connection takes files your system sends on its own, over SFTP or through the API. To upload a spreadsheet of your people yourself, use importing users.

Why can’t I see CSV file over SFTP under Connect an HR system?

Section titled “Why can’t I see CSV file over SFTP under Connect an HR system?”

CSV HR connections are switched on for each account by Learnient. Contact support to have them switched on for yours.

Open the Files tab. If the file isn’t listed, check that its name matches the File name pattern and that it’s in the Folder, and that it hadn’t changed in the two minutes before the check. If it’s listed as Waiting, map the columns or approve the held sync. If it’s Rejected, choose the arrow at the end of its row to open its sync and see why.

Why does my CSV HR connection still say Pending?

Section titled “Why does my CSV HR connection still say Pending?”

A CSV HR connection over SFTP that signs in with A key Learnient generates stays Pending until you’ve added its Public key to your server and chosen Test connection.