Skip to main content
POST
Import contacts
Add many contacts at once from a CSV or Excel file, up to 10 MB and 2,000 rows. An import takes three requests: get an upload URL, upload the file to it, and start the import. The import then runs in the background, so you poll its status until it finishes.

Importing a file

1

Get an upload URL

Send your file’s name, so Detrack knows how to read it. The response has the upload url and the file’s id.
2

Upload the file

PUT the file to url exactly as returned, within 15 minutes. Don’t send your API key: the URL is already signed. If the response had any headers, send those too.
3

Start the import

Send the id from the first step. The response is the import’s own id, with status set to processing.
4

Poll until it finishes

Call Get import status with the import’s id until status is completed or failed.

The file

Use a .csv, .xlsx, or .xls file. Detrack finds the header row by its Address column, then matches the other columns by their header names, ignoring case. Your account can rename columns, so download a sample file to get the exact names. Rows with no values are skipped. A file can have up to 2,000 rows under the header row. Rows with no values don’t count. A bigger file fails with too_many_rows and nothing is imported, so split it into smaller files. Each row needs a name or company name, and an address unless it has an address line (the Address 1 to Address 3 columns, by default). Rows that can’t be saved are listed in the import’s invalid_contacts. The file’s other rows are still saved.

Replacing your contacts

Send "delete": true to delete the contacts your API key’s user can see before the file is imported. It’s ignored if the user can’t delete contacts.
Send delete as a JSON true or false, or leave it out. Any other value, even the string "false", 0, or "", counts as true and deletes the contacts.Detrack checks the file’s size and row count first, so a file that fails with file_too_large or too_many_rows deletes nothing. Otherwise it deletes the contacts before it imports the file. If the import then fails, for example with missing_required_headers, the deleted contacts aren’t restored. Try the file without delete first.

Import errors

A failed import has one of these codes in errors: Request errors, such as an id you didn’t upload, return 422 straight away and nothing is imported or deleted.

Authorizations

X-API-KEY
string
header
required

Your Detrack API key, from Integrations > API Key in the dashboard.

Body

application/json
data
object
required

Response

The import has started. Poll its id until status changes.

data
object