Create import
curl --request POST \
--url https://app.sure.am/api/v1/imports \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"raw_file_content": "<string>",
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"publish": "<string>",
"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>",
"amount_type_inflow_value": "<string>"
}
'import requests
url = "https://app.sure.am/api/v1/imports"
payload = {
"raw_file_content": "<string>",
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"publish": "<string>",
"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>",
"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>',
account_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
publish: '<string>',
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>',
amount_type_inflow_value: '<string>'
})
};
fetch('https://app.sure.am/api/v1/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://app.sure.am/api/v1/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([
'raw_file_content' => '<string>',
'account_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'publish' => '<string>',
'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>',
'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"
payload := strings.NewReader("{\n \"raw_file_content\": \"<string>\",\n \"account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"publish\": \"<string>\",\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 \"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")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"raw_file_content\": \"<string>\",\n \"account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"publish\": \"<string>\",\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 \"amount_type_inflow_value\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.sure.am/api/v1/imports")
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 \"account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"publish\": \"<string>\",\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 \"amount_type_inflow_value\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "TransactionImport",
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"status_detail": {
"uploaded": true,
"configured": true,
"terminal": true,
"cleaned": true,
"publishable": true,
"revertable": true
},
"configuration": {
"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>",
"date_format": "<string>",
"number_format": "<string>",
"signage_convention": "<string>"
},
"stats": {
"rows_count": 1,
"valid_rows_count": 1,
"invalid_rows_count": 1,
"mappings_count": 1,
"unassigned_mappings_count": 1
},
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"error": "<string>",
"verification": {
"expected_record_counts": {},
"readback": {
"status": "not_verified",
"checked_at": "2023-11-07T05:31:56Z",
"expected_record_counts": {},
"before_counts": {},
"after_counts": {},
"actual_delta_counts": {},
"checked_counts": {},
"mismatches": {},
"error": "<string>"
}
}
}
}{
"error": "<string>",
"message": "<string>",
"details": [
"<string>"
],
"errors": [
"<string>"
]
}{
"error": "<string>",
"message": "<string>",
"details": [
"<string>"
],
"errors": [
"<string>"
]
}{
"error": "<string>",
"import_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"message": "<string>"
}Imports
Create import
Create a new import from raw CSV content, inline Sure NDJSON content, or an uploaded Sure NDJSON file. CSV content is limited to 10MB.
POST
/
api
/
v1
/
imports
Create import
curl --request POST \
--url https://app.sure.am/api/v1/imports \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"raw_file_content": "<string>",
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"publish": "<string>",
"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>",
"amount_type_inflow_value": "<string>"
}
'import requests
url = "https://app.sure.am/api/v1/imports"
payload = {
"raw_file_content": "<string>",
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"publish": "<string>",
"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>",
"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>',
account_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
publish: '<string>',
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>',
amount_type_inflow_value: '<string>'
})
};
fetch('https://app.sure.am/api/v1/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://app.sure.am/api/v1/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([
'raw_file_content' => '<string>',
'account_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'publish' => '<string>',
'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>',
'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"
payload := strings.NewReader("{\n \"raw_file_content\": \"<string>\",\n \"account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"publish\": \"<string>\",\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 \"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")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"raw_file_content\": \"<string>\",\n \"account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"publish\": \"<string>\",\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 \"amount_type_inflow_value\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.sure.am/api/v1/imports")
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 \"account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"publish\": \"<string>\",\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 \"amount_type_inflow_value\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "TransactionImport",
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"status_detail": {
"uploaded": true,
"configured": true,
"terminal": true,
"cleaned": true,
"publishable": true,
"revertable": true
},
"configuration": {
"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>",
"date_format": "<string>",
"number_format": "<string>",
"signage_convention": "<string>"
},
"stats": {
"rows_count": 1,
"valid_rows_count": 1,
"invalid_rows_count": 1,
"mappings_count": 1,
"unassigned_mappings_count": 1
},
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"error": "<string>",
"verification": {
"expected_record_counts": {},
"readback": {
"status": "not_verified",
"checked_at": "2023-11-07T05:31:56Z",
"expected_record_counts": {},
"before_counts": {},
"after_counts": {},
"actual_delta_counts": {},
"checked_counts": {},
"mismatches": {},
"error": "<string>"
}
}
}
}{
"error": "<string>",
"message": "<string>",
"details": [
"<string>"
],
"errors": [
"<string>"
]
}{
"error": "<string>",
"message": "<string>",
"details": [
"<string>"
],
"errors": [
"<string>"
]
}{
"error": "<string>",
"import_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"message": "<string>"
}Authorizations
Body
application/jsonmultipart/form-data
Was this page helpful?