Import Contacts
curl --request POST \
--url https://api.example.com/contacts/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"s3_key": "<string>",
"mapping": {}
}
'import requests
url = "https://api.example.com/contacts/import"
payload = {
"s3_key": "<string>",
"mapping": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({s3_key: '<string>', mapping: {}})
};
fetch('https://api.example.com/contacts/import', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/contacts/import",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
's3_key' => '<string>',
'mapping' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/contacts/import"
payload := strings.NewReader("{\n \"s3_key\": \"<string>\",\n \"mapping\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/contacts/import")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"s3_key\": \"<string>\",\n \"mapping\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/contacts/import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"s3_key\": \"<string>\",\n \"mapping\": {}\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Contacts
Start an Import
Start an async import of the stashed CSV with a confirmed mapping.
Inserts a contact_imports job row and starts ContactImportWorkflow,
returning 202 { import_id } immediately. The frontend polls
GET /contacts/imports/{import_id} for progress + results.
POST
/
contacts
/
import
Import Contacts
curl --request POST \
--url https://api.example.com/contacts/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"s3_key": "<string>",
"mapping": {}
}
'import requests
url = "https://api.example.com/contacts/import"
payload = {
"s3_key": "<string>",
"mapping": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({s3_key: '<string>', mapping: {}})
};
fetch('https://api.example.com/contacts/import', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/contacts/import",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
's3_key' => '<string>',
'mapping' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/contacts/import"
payload := strings.NewReader("{\n \"s3_key\": \"<string>\",\n \"mapping\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/contacts/import")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"s3_key\": \"<string>\",\n \"mapping\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/contacts/import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"s3_key\": \"<string>\",\n \"mapping\": {}\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Third step of the CSV import flow. Inserts a
contact_imports job row (status: "pending") and starts ContactImportWorkflow on Temporal, then returns immediately — the actual parsing/inserting happens asynchronously. If the workflow fails to start, the job row is patched to status: "failed" synchronously and the request itself still returns 502.
Rows are matched against mapping (raw CSV header → canonical field, same keys as fields[].key from Preview; "" means “don’t import this column”). A row needs at least one identity field after mapping to be imported; a row is skipped if its email already exists in the org, or repeats an email already used earlier in the same file. Type-checking is lenient — an invalid cell (e.g. a malformed phone number) is dropped and the row still imports as a warning, not a hard failure.
Beyond the 15 MB file-size cap shared by all three steps, there’s a second limit that’s easy to miss: at most 5,000 rows are imported per file. A CSV can sit well under 15 MB and still blow past it. Rows after the 5,000th aren’t a hard failure — each is skipped individually with the reason exceeds the 5,000-row limit, counted in skipped on Get import status and annotated per-row in that job’s result CSV, while the job itself still finishes as completed. Split larger files into separate import jobs.
Auth
Requires a CRM manage scope and an active organization on the token. Any*:manage scope qualifies — in practice contacts:manage, deals:manage, companies:manage, or activities:manage.
Response
202 Accepted:
| Field | Type | Description |
|---|---|---|
import_id | string | Also the Temporal workflow ID. Pass to Get import status. |
Errors
| Status | Cause |
|---|---|
404 | s3_key no longer exists in S3 — re-upload. |
422 | mapping names a target field that isn’t a known canonical field. |
502 | Failed to start the Temporal workflow. |
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Start an async import of a stashed CSV with a confirmed column mapping.
mapping is raw-CSV-header → canonical field ("" = don't import).
Response
Successful Response