Validate import content without creating an import
curl --request POST \
--url https://app.sure.am/api/v1/imports/preflight \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"raw_file_content": "<string>",
"file": "<string>",
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"date_col_label": "<string>",
"amount_col_label": "<string>",
"name_col_label": "<string>",
"category_col_label": "<string>",
"tags_col_label": "<string>",
"notes_col_label": "<string>",
"account_col_label": "<string>",
"qty_col_label": "<string>",
"ticker_col_label": "<string>",
"price_col_label": "<string>",
"entity_type_col_label": "<string>",
"currency_col_label": "<string>",
"exchange_operating_mic_col_label": "<string>",
"date_format": "<string>",
"rows_to_skip": 1,
"amount_type_inflow_value": "<string>"
}
'import requests
url = "https://app.sure.am/api/v1/imports/preflight"
payload = {
"raw_file_content": "<string>",
"file": "<string>",
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"date_col_label": "<string>",
"amount_col_label": "<string>",
"name_col_label": "<string>",
"category_col_label": "<string>",
"tags_col_label": "<string>",
"notes_col_label": "<string>",
"account_col_label": "<string>",
"qty_col_label": "<string>",
"ticker_col_label": "<string>",
"price_col_label": "<string>",
"entity_type_col_label": "<string>",
"currency_col_label": "<string>",
"exchange_operating_mic_col_label": "<string>",
"date_format": "<string>",
"rows_to_skip": 1,
"amount_type_inflow_value": "<string>"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
raw_file_content: '<string>',
file: '<string>',
account_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
date_col_label: '<string>',
amount_col_label: '<string>',
name_col_label: '<string>',
category_col_label: '<string>',
tags_col_label: '<string>',
notes_col_label: '<string>',
account_col_label: '<string>',
qty_col_label: '<string>',
ticker_col_label: '<string>',
price_col_label: '<string>',
entity_type_col_label: '<string>',
currency_col_label: '<string>',
exchange_operating_mic_col_label: '<string>',
date_format: '<string>',
rows_to_skip: 1,
amount_type_inflow_value: '<string>'
})
};
fetch('https://app.sure.am/api/v1/imports/preflight', 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://app.sure.am/api/v1/imports/preflight",
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([
'raw_file_content' => '<string>',
'file' => '<string>',
'account_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'date_col_label' => '<string>',
'amount_col_label' => '<string>',
'name_col_label' => '<string>',
'category_col_label' => '<string>',
'tags_col_label' => '<string>',
'notes_col_label' => '<string>',
'account_col_label' => '<string>',
'qty_col_label' => '<string>',
'ticker_col_label' => '<string>',
'price_col_label' => '<string>',
'entity_type_col_label' => '<string>',
'currency_col_label' => '<string>',
'exchange_operating_mic_col_label' => '<string>',
'date_format' => '<string>',
'rows_to_skip' => 1,
'amount_type_inflow_value' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$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://app.sure.am/api/v1/imports/preflight"
payload := strings.NewReader("{\n \"raw_file_content\": \"<string>\",\n \"file\": \"<string>\",\n \"account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"date_col_label\": \"<string>\",\n \"amount_col_label\": \"<string>\",\n \"name_col_label\": \"<string>\",\n \"category_col_label\": \"<string>\",\n \"tags_col_label\": \"<string>\",\n \"notes_col_label\": \"<string>\",\n \"account_col_label\": \"<string>\",\n \"qty_col_label\": \"<string>\",\n \"ticker_col_label\": \"<string>\",\n \"price_col_label\": \"<string>\",\n \"entity_type_col_label\": \"<string>\",\n \"currency_col_label\": \"<string>\",\n \"exchange_operating_mic_col_label\": \"<string>\",\n \"date_format\": \"<string>\",\n \"rows_to_skip\": 1,\n \"amount_type_inflow_value\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
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://app.sure.am/api/v1/imports/preflight")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"raw_file_content\": \"<string>\",\n \"file\": \"<string>\",\n \"account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"date_col_label\": \"<string>\",\n \"amount_col_label\": \"<string>\",\n \"name_col_label\": \"<string>\",\n \"category_col_label\": \"<string>\",\n \"tags_col_label\": \"<string>\",\n \"notes_col_label\": \"<string>\",\n \"account_col_label\": \"<string>\",\n \"qty_col_label\": \"<string>\",\n \"ticker_col_label\": \"<string>\",\n \"price_col_label\": \"<string>\",\n \"entity_type_col_label\": \"<string>\",\n \"currency_col_label\": \"<string>\",\n \"exchange_operating_mic_col_label\": \"<string>\",\n \"date_format\": \"<string>\",\n \"rows_to_skip\": 1,\n \"amount_type_inflow_value\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.sure.am/api/v1/imports/preflight")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"raw_file_content\": \"<string>\",\n \"file\": \"<string>\",\n \"account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"date_col_label\": \"<string>\",\n \"amount_col_label\": \"<string>\",\n \"name_col_label\": \"<string>\",\n \"category_col_label\": \"<string>\",\n \"tags_col_label\": \"<string>\",\n \"notes_col_label\": \"<string>\",\n \"account_col_label\": \"<string>\",\n \"qty_col_label\": \"<string>\",\n \"ticker_col_label\": \"<string>\",\n \"price_col_label\": \"<string>\",\n \"entity_type_col_label\": \"<string>\",\n \"currency_col_label\": \"<string>\",\n \"exchange_operating_mic_col_label\": \"<string>\",\n \"date_format\": \"<string>\",\n \"rows_to_skip\": 1,\n \"amount_type_inflow_value\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"type": "TransactionImport",
"valid": true,
"content": {
"filename": "<string>",
"content_type": "<string>",
"byte_size": 1
},
"stats": {
"rows_count": 1,
"valid_rows_count": 1,
"invalid_rows_count": 1,
"entity_counts": {},
"record_type_counts": {}
},
"errors": [
{
"code": "<string>",
"message": "<string>"
}
],
"warnings": [
"<string>"
],
"headers": [
"<string>"
],
"required_headers": [
"<string>"
],
"missing_required_headers": [
"<string>"
]
}
}{
"error": "<string>",
"message": "<string>",
"details": [
"<string>"
],
"errors": [
"<string>"
]
}{
"error": "<string>",
"message": "<string>",
"details": [
"<string>"
],
"errors": [
"<string>"
]
}{
"error": "<string>",
"message": "<string>",
"details": [
"<string>"
],
"errors": [
"<string>"
]
}Imports
Validate import content without creating an import
Validate CSV or Sure NDJSON import content and return counts, headers, warnings, and validation errors without persisting an import or enqueueing jobs. CSV content is limited to 10MB.
POST
/
api
/
v1
/
imports
/
preflight
Validate import content without creating an import
curl --request POST \
--url https://app.sure.am/api/v1/imports/preflight \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"raw_file_content": "<string>",
"file": "<string>",
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"date_col_label": "<string>",
"amount_col_label": "<string>",
"name_col_label": "<string>",
"category_col_label": "<string>",
"tags_col_label": "<string>",
"notes_col_label": "<string>",
"account_col_label": "<string>",
"qty_col_label": "<string>",
"ticker_col_label": "<string>",
"price_col_label": "<string>",
"entity_type_col_label": "<string>",
"currency_col_label": "<string>",
"exchange_operating_mic_col_label": "<string>",
"date_format": "<string>",
"rows_to_skip": 1,
"amount_type_inflow_value": "<string>"
}
'import requests
url = "https://app.sure.am/api/v1/imports/preflight"
payload = {
"raw_file_content": "<string>",
"file": "<string>",
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"date_col_label": "<string>",
"amount_col_label": "<string>",
"name_col_label": "<string>",
"category_col_label": "<string>",
"tags_col_label": "<string>",
"notes_col_label": "<string>",
"account_col_label": "<string>",
"qty_col_label": "<string>",
"ticker_col_label": "<string>",
"price_col_label": "<string>",
"entity_type_col_label": "<string>",
"currency_col_label": "<string>",
"exchange_operating_mic_col_label": "<string>",
"date_format": "<string>",
"rows_to_skip": 1,
"amount_type_inflow_value": "<string>"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
raw_file_content: '<string>',
file: '<string>',
account_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
date_col_label: '<string>',
amount_col_label: '<string>',
name_col_label: '<string>',
category_col_label: '<string>',
tags_col_label: '<string>',
notes_col_label: '<string>',
account_col_label: '<string>',
qty_col_label: '<string>',
ticker_col_label: '<string>',
price_col_label: '<string>',
entity_type_col_label: '<string>',
currency_col_label: '<string>',
exchange_operating_mic_col_label: '<string>',
date_format: '<string>',
rows_to_skip: 1,
amount_type_inflow_value: '<string>'
})
};
fetch('https://app.sure.am/api/v1/imports/preflight', 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://app.sure.am/api/v1/imports/preflight",
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([
'raw_file_content' => '<string>',
'file' => '<string>',
'account_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'date_col_label' => '<string>',
'amount_col_label' => '<string>',
'name_col_label' => '<string>',
'category_col_label' => '<string>',
'tags_col_label' => '<string>',
'notes_col_label' => '<string>',
'account_col_label' => '<string>',
'qty_col_label' => '<string>',
'ticker_col_label' => '<string>',
'price_col_label' => '<string>',
'entity_type_col_label' => '<string>',
'currency_col_label' => '<string>',
'exchange_operating_mic_col_label' => '<string>',
'date_format' => '<string>',
'rows_to_skip' => 1,
'amount_type_inflow_value' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$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://app.sure.am/api/v1/imports/preflight"
payload := strings.NewReader("{\n \"raw_file_content\": \"<string>\",\n \"file\": \"<string>\",\n \"account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"date_col_label\": \"<string>\",\n \"amount_col_label\": \"<string>\",\n \"name_col_label\": \"<string>\",\n \"category_col_label\": \"<string>\",\n \"tags_col_label\": \"<string>\",\n \"notes_col_label\": \"<string>\",\n \"account_col_label\": \"<string>\",\n \"qty_col_label\": \"<string>\",\n \"ticker_col_label\": \"<string>\",\n \"price_col_label\": \"<string>\",\n \"entity_type_col_label\": \"<string>\",\n \"currency_col_label\": \"<string>\",\n \"exchange_operating_mic_col_label\": \"<string>\",\n \"date_format\": \"<string>\",\n \"rows_to_skip\": 1,\n \"amount_type_inflow_value\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
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://app.sure.am/api/v1/imports/preflight")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"raw_file_content\": \"<string>\",\n \"file\": \"<string>\",\n \"account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"date_col_label\": \"<string>\",\n \"amount_col_label\": \"<string>\",\n \"name_col_label\": \"<string>\",\n \"category_col_label\": \"<string>\",\n \"tags_col_label\": \"<string>\",\n \"notes_col_label\": \"<string>\",\n \"account_col_label\": \"<string>\",\n \"qty_col_label\": \"<string>\",\n \"ticker_col_label\": \"<string>\",\n \"price_col_label\": \"<string>\",\n \"entity_type_col_label\": \"<string>\",\n \"currency_col_label\": \"<string>\",\n \"exchange_operating_mic_col_label\": \"<string>\",\n \"date_format\": \"<string>\",\n \"rows_to_skip\": 1,\n \"amount_type_inflow_value\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.sure.am/api/v1/imports/preflight")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"raw_file_content\": \"<string>\",\n \"file\": \"<string>\",\n \"account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"date_col_label\": \"<string>\",\n \"amount_col_label\": \"<string>\",\n \"name_col_label\": \"<string>\",\n \"category_col_label\": \"<string>\",\n \"tags_col_label\": \"<string>\",\n \"notes_col_label\": \"<string>\",\n \"account_col_label\": \"<string>\",\n \"qty_col_label\": \"<string>\",\n \"ticker_col_label\": \"<string>\",\n \"price_col_label\": \"<string>\",\n \"entity_type_col_label\": \"<string>\",\n \"currency_col_label\": \"<string>\",\n \"exchange_operating_mic_col_label\": \"<string>\",\n \"date_format\": \"<string>\",\n \"rows_to_skip\": 1,\n \"amount_type_inflow_value\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"type": "TransactionImport",
"valid": true,
"content": {
"filename": "<string>",
"content_type": "<string>",
"byte_size": 1
},
"stats": {
"rows_count": 1,
"valid_rows_count": 1,
"invalid_rows_count": 1,
"entity_counts": {},
"record_type_counts": {}
},
"errors": [
{
"code": "<string>",
"message": "<string>"
}
],
"warnings": [
"<string>"
],
"headers": [
"<string>"
],
"required_headers": [
"<string>"
],
"missing_required_headers": [
"<string>"
]
}
}{
"error": "<string>",
"message": "<string>",
"details": [
"<string>"
],
"errors": [
"<string>"
]
}{
"error": "<string>",
"message": "<string>",
"details": [
"<string>"
],
"errors": [
"<string>"
]
}{
"error": "<string>",
"message": "<string>",
"details": [
"<string>"
],
"errors": [
"<string>"
]
}Authorizations
Body
application/jsonmultipart/form-data
Was this page helpful?