Preview CSV import
curl --request POST \
--url https://api.emailr.dev/v1/contacts/import/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file_content": "ZW1haWwsZmlyc3RfbmFtZSxsYXN0X25hbWUKam9obkBleGFtcGxlLmNvbSxKb2huLERvZQ==",
"is_base64": true
}
'import requests
url = "https://api.emailr.dev/v1/contacts/import/preview"
payload = {
"file_content": "ZW1haWwsZmlyc3RfbmFtZSxsYXN0X25hbWUKam9obkBleGFtcGxlLmNvbSxKb2huLERvZQ==",
"is_base64": True
}
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({
file_content: 'ZW1haWwsZmlyc3RfbmFtZSxsYXN0X25hbWUKam9obkBleGFtcGxlLmNvbSxKb2huLERvZQ==',
is_base64: true
})
};
fetch('https://api.emailr.dev/v1/contacts/import/preview', 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.emailr.dev/v1/contacts/import/preview",
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([
'file_content' => 'ZW1haWwsZmlyc3RfbmFtZSxsYXN0X25hbWUKam9obkBleGFtcGxlLmNvbSxKb2huLERvZQ==',
'is_base64' => true
]),
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.emailr.dev/v1/contacts/import/preview"
payload := strings.NewReader("{\n \"file_content\": \"ZW1haWwsZmlyc3RfbmFtZSxsYXN0X25hbWUKam9obkBleGFtcGxlLmNvbSxKb2huLERvZQ==\",\n \"is_base64\": true\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.emailr.dev/v1/contacts/import/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"file_content\": \"ZW1haWwsZmlyc3RfbmFtZSxsYXN0X25hbWUKam9obkBleGFtcGxlLmNvbSxKb2huLERvZQ==\",\n \"is_base64\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.emailr.dev/v1/contacts/import/preview")
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 \"file_content\": \"ZW1haWwsZmlyc3RfbmFtZSxsYXN0X25hbWUKam9obkBleGFtcGxlLmNvbSxKb2huLERvZQ==\",\n \"is_base64\": true\n}"
response = http.request(request)
puts response.read_body{
"headers": [
"email",
"first_name",
"last_name",
"company"
],
"preview_rows": [
{
"email": "john@example.com",
"first_name": "John",
"last_name": "Doe",
"company": "Acme"
},
{
"email": "jane@example.com",
"first_name": "Jane",
"last_name": "Smith",
"company": "Corp"
}
],
"total_rows": 150,
"suggested_mappings": {
"email": "email",
"first_name": "first_name",
"last_name": "last_name",
"company": null
}
}{
"error": "An error occurred",
"code": "VALIDATION_ERROR",
"details": "<unknown>"
}{
"error": "An error occurred",
"code": "VALIDATION_ERROR",
"details": "<unknown>"
}import
Preview CSV import
Parse a CSV file and return column headers with a preview of the first 5 rows
POST
/
v1
/
contacts
/
import
/
preview
Preview CSV import
curl --request POST \
--url https://api.emailr.dev/v1/contacts/import/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file_content": "ZW1haWwsZmlyc3RfbmFtZSxsYXN0X25hbWUKam9obkBleGFtcGxlLmNvbSxKb2huLERvZQ==",
"is_base64": true
}
'import requests
url = "https://api.emailr.dev/v1/contacts/import/preview"
payload = {
"file_content": "ZW1haWwsZmlyc3RfbmFtZSxsYXN0X25hbWUKam9obkBleGFtcGxlLmNvbSxKb2huLERvZQ==",
"is_base64": True
}
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({
file_content: 'ZW1haWwsZmlyc3RfbmFtZSxsYXN0X25hbWUKam9obkBleGFtcGxlLmNvbSxKb2huLERvZQ==',
is_base64: true
})
};
fetch('https://api.emailr.dev/v1/contacts/import/preview', 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.emailr.dev/v1/contacts/import/preview",
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([
'file_content' => 'ZW1haWwsZmlyc3RfbmFtZSxsYXN0X25hbWUKam9obkBleGFtcGxlLmNvbSxKb2huLERvZQ==',
'is_base64' => true
]),
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.emailr.dev/v1/contacts/import/preview"
payload := strings.NewReader("{\n \"file_content\": \"ZW1haWwsZmlyc3RfbmFtZSxsYXN0X25hbWUKam9obkBleGFtcGxlLmNvbSxKb2huLERvZQ==\",\n \"is_base64\": true\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.emailr.dev/v1/contacts/import/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"file_content\": \"ZW1haWwsZmlyc3RfbmFtZSxsYXN0X25hbWUKam9obkBleGFtcGxlLmNvbSxKb2huLERvZQ==\",\n \"is_base64\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.emailr.dev/v1/contacts/import/preview")
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 \"file_content\": \"ZW1haWwsZmlyc3RfbmFtZSxsYXN0X25hbWUKam9obkBleGFtcGxlLmNvbSxKb2huLERvZQ==\",\n \"is_base64\": true\n}"
response = http.request(request)
puts response.read_body{
"headers": [
"email",
"first_name",
"last_name",
"company"
],
"preview_rows": [
{
"email": "john@example.com",
"first_name": "John",
"last_name": "Doe",
"company": "Acme"
},
{
"email": "jane@example.com",
"first_name": "Jane",
"last_name": "Smith",
"company": "Corp"
}
],
"total_rows": 150,
"suggested_mappings": {
"email": "email",
"first_name": "first_name",
"last_name": "last_name",
"company": null
}
}{
"error": "An error occurred",
"code": "VALIDATION_ERROR",
"details": "<unknown>"
}{
"error": "An error occurred",
"code": "VALIDATION_ERROR",
"details": "<unknown>"
}Authorizations
API key authentication. Use your API key as the bearer token.
Body
application/json
Response
CSV preview with headers and sample rows
Column headers extracted from the CSV file
Example:
[
"email",
"first_name",
"last_name",
"company"
]
First 5 rows of data as objects with header keys
Show child attributes
Show child attributes
Example:
[
{
"email": "john@example.com",
"first_name": "John",
"last_name": "Doe",
"company": "Acme"
},
{
"email": "jane@example.com",
"first_name": "Jane",
"last_name": "Smith",
"company": "Corp"
}
]
Total number of data rows in the CSV (excluding header)
Example:
150
Auto-suggested mappings for column headers to contact properties. Value is null if no suggestion.
Show child attributes
Show child attributes
Example:
{
"email": "email",
"first_name": "first_name",
"last_name": "last_name",
"company": null
}
⌘I