Start a contact import
curl --request POST \
--url https://api.tented.ai/v1/contacts/imports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source": "upload",
"file_name": "contacts.csv",
"content_type": "text/csv"
}
'import requests
url = "https://api.tented.ai/v1/contacts/imports"
payload = {
"source": "upload",
"file_name": "contacts.csv",
"content_type": "text/csv"
}
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({source: 'upload', file_name: 'contacts.csv', content_type: 'text/csv'})
};
fetch('https://api.tented.ai/v1/contacts/imports', 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.tented.ai/v1/contacts/imports",
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([
'source' => 'upload',
'file_name' => 'contacts.csv',
'content_type' => 'text/csv'
]),
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.tented.ai/v1/contacts/imports"
payload := strings.NewReader("{\n \"source\": \"upload\",\n \"file_name\": \"contacts.csv\",\n \"content_type\": \"text/csv\"\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.tented.ai/v1/contacts/imports")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source\": \"upload\",\n \"file_name\": \"contacts.csv\",\n \"content_type\": \"text/csv\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tented.ai/v1/contacts/imports")
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 \"source\": \"upload\",\n \"file_name\": \"contacts.csv\",\n \"content_type\": \"text/csv\"\n}"
response = http.request(request)
puts response.read_body{
"import_session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"file_name": "<string>",
"upload_url": "<string>",
"upload_headers": {},
"expires_in_seconds": 123
}{
"error": "<string>",
"error_code": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"limit": 123,
"current": 123
}{
"error": "<string>",
"error_code": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"limit": 123,
"current": 123
}{
"error": "<string>",
"error_code": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"limit": 123,
"current": 123
}Contact Imports
Start a contact import
Create a contact import session. Two modes, selected by source:
upload— returns a presigned S3PUTURL. Upload the raw CSV bytes toupload_urlwith the returnedupload_headersbefore the URL expires (expires_in_seconds, 15 minutes). Source files up to 350 MB are supported. Only CSV content types are accepted (text/csv,application/csv,application/vnd.ms-excel,text/plain).rows— send rows inline as JSON objects (1–1,000 rows). Keys are column headers; the union of keys across all rows becomes the CSV header row. Values are stringified;nullbecomes an empty string. Inline request bodies are limited to 5 MB — larger bodies are rejected with413(this keeps requests below the platform’s 6 MB payload ceiling, so treat ~5 MB as the practical limit and useuploadmode for anything bigger).
After creating a session, call POST /v1/contacts/imports/{sessionId}/preview to get proposed column mappings, then POST /v1/contacts/imports/{sessionId}/execute to run the import. Sessions expire after 7 days and can each be executed once.
POST
/
v1
/
contacts
/
imports
Start a contact import
curl --request POST \
--url https://api.tented.ai/v1/contacts/imports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source": "upload",
"file_name": "contacts.csv",
"content_type": "text/csv"
}
'import requests
url = "https://api.tented.ai/v1/contacts/imports"
payload = {
"source": "upload",
"file_name": "contacts.csv",
"content_type": "text/csv"
}
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({source: 'upload', file_name: 'contacts.csv', content_type: 'text/csv'})
};
fetch('https://api.tented.ai/v1/contacts/imports', 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.tented.ai/v1/contacts/imports",
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([
'source' => 'upload',
'file_name' => 'contacts.csv',
'content_type' => 'text/csv'
]),
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.tented.ai/v1/contacts/imports"
payload := strings.NewReader("{\n \"source\": \"upload\",\n \"file_name\": \"contacts.csv\",\n \"content_type\": \"text/csv\"\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.tented.ai/v1/contacts/imports")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source\": \"upload\",\n \"file_name\": \"contacts.csv\",\n \"content_type\": \"text/csv\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tented.ai/v1/contacts/imports")
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 \"source\": \"upload\",\n \"file_name\": \"contacts.csv\",\n \"content_type\": \"text/csv\"\n}"
response = http.request(request)
puts response.read_body{
"import_session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"file_name": "<string>",
"upload_url": "<string>",
"upload_headers": {},
"expires_in_seconds": 123
}{
"error": "<string>",
"error_code": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"limit": 123,
"current": 123
}{
"error": "<string>",
"error_code": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"limit": 123,
"current": 123
}{
"error": "<string>",
"error_code": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"limit": 123,
"current": 123
}Authorizations
Body
application/json
- Upload mode
- Inline rows mode
Content type of the upcoming upload. Must be one of text/csv, application/csv, application/vnd.ms-excel, or text/plain; anything else is rejected with 400. The presigned URL is bound to this content type — send the same Content-Type header on the PUT.
Required string length:
1 - 255Response
Import session created. upload mode returns a presigned upload URL; rows mode returns the stored row count.
- Upload session
- Rows session