RequestUploadURL
curl --request POST \
--url https://api.trysela.com/api/ingestion/upload/ \
--header 'Authorization: Token <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"source": "crm_export",
"filename": "may-leads.csv"
}'import requests
url = "https://api.trysela.com/api/ingestion/upload/"
payload = {
"source": "crm_export",
"filename": "may-leads.csv"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({source: 'crm_export', filename: 'may-leads.csv'})
};
fetch('https://api.trysela.com/api/ingestion/upload/', 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.trysela.com/api/ingestion/upload/",
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' => 'crm_export',
'filename' => 'may-leads.csv'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.trysela.com/api/ingestion/upload/"
payload := strings.NewReader("{\n \"source\": \"crm_export\",\n \"filename\": \"may-leads.csv\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://api.trysela.com/api/ingestion/upload/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"source\": \"crm_export\",\n \"filename\": \"may-leads.csv\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trysela.com/api/ingestion/upload/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source\": \"crm_export\",\n \"filename\": \"may-leads.csv\"\n}"
response = http.request(request)
puts response.read_body{
"signed_url": "https://storage.example.com/upload/path?X-Amz-Signature=example"
}File Ingestion
Create a File Upload URL
Creates a temporary URL for uploading a CSV file to a preconfigured Sela file ingestion source. The source value is provided by Sela and determines how the uploaded CSV is processed. Sela configures which CSV column is used as the row lookup key. First call this endpoint with a source and filename, then upload the file to the returned signed_url using an HTTP PUT request. The upload URL expires after one hour.
POST
/
api
/
ingestion
/
upload
/
RequestUploadURL
curl --request POST \
--url https://api.trysela.com/api/ingestion/upload/ \
--header 'Authorization: Token <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"source": "crm_export",
"filename": "may-leads.csv"
}'import requests
url = "https://api.trysela.com/api/ingestion/upload/"
payload = {
"source": "crm_export",
"filename": "may-leads.csv"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({source: 'crm_export', filename: 'may-leads.csv'})
};
fetch('https://api.trysela.com/api/ingestion/upload/', 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.trysela.com/api/ingestion/upload/",
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' => 'crm_export',
'filename' => 'may-leads.csv'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.trysela.com/api/ingestion/upload/"
payload := strings.NewReader("{\n \"source\": \"crm_export\",\n \"filename\": \"may-leads.csv\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://api.trysela.com/api/ingestion/upload/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"source\": \"crm_export\",\n \"filename\": \"may-leads.csv\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trysela.com/api/ingestion/upload/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source\": \"crm_export\",\n \"filename\": \"may-leads.csv\"\n}"
response = http.request(request)
puts response.read_body{
"signed_url": "https://storage.example.com/upload/path?X-Amz-Signature=example"
}Authorizations
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data