Skip to main content
POST
/
api
/
v1
/
sessions
/
{session_id}
/
upload
/
excel
Upload Excel with multi-sheet and sender profile support
curl --request POST \
  --url https://api.example.com/api/v1/sessions/{session_id}/upload/excel \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form file='@example-file' \
  --form 'sheet_config=<string>' \
  --form has_header=true \
  --form update_sender_data=true
import requests

url = "https://api.example.com/api/v1/sessions/{session_id}/upload/excel"

files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
    "sheet_config": "<string>",
    "has_header": "true",
    "update_sender_data": "true"
}
headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, data=payload, files=files, headers=headers)

print(response.text)
const form = new FormData();
form.append('file', '<string>');
form.append('sheet_config', '<string>');
form.append('has_header', 'true');
form.append('update_sender_data', 'true');

const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

options.body = form;

fetch('https://api.example.com/api/v1/sessions/{session_id}/upload/excel', 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.example.com/api/v1/sessions/{session_id}/upload/excel",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"sheet_config\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"has_header\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"update_sender_data\"\r\n\r\ntrue\r\n-----011000010111000001101001--",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: multipart/form-data"
  ],
]);

$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.example.com/api/v1/sessions/{session_id}/upload/excel"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"sheet_config\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"has_header\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"update_sender_data\"\r\n\r\ntrue\r\n-----011000010111000001101001--")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")

	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.example.com/api/v1/sessions/{session_id}/upload/excel")
  .header("Authorization", "Bearer <token>")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"sheet_config\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"has_header\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"update_sender_data\"\r\n\r\ntrue\r\n-----011000010111000001101001--")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/api/v1/sessions/{session_id}/upload/excel")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"sheet_config\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"has_header\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"update_sender_data\"\r\n\r\ntrue\r\n-----011000010111000001101001--"

response = http.request(request)
puts response.read_body
{
  "session_id": "<string>",
  "status": "<string>",
  "leads_queued": 123,
  "sender_data_sources": 123,
  "file_info": {},
  "message": "<string>",
  "dataset_id": "<string>",
  "quota_info": {},
  "job_id": "<string>",
  "estimated_completion_time": 123,
  "processing_status": "<string>"
}
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

session_id
string
required

Body

multipart/form-data
file
file
required

Excel file to upload

sheet_config
string
required

JSON string with enhanced sheet configuration

has_header
boolean
default:true

Whether the sheets have header rows

update_sender_data
boolean
default:true

Whether to update session sender data

Response

Successful Response

Enhanced response model for session-based upload with quota information.

session_id
string
required

Session identifier for the upload

status
string
required

Upload status

leads_queued
integer
required

Number of leads queued for processing

sender_data_sources
integer
required

Number of sender data sources identified

file_info
File Info · object
required

Information about the uploaded file

message
string
required

Success message

dataset_id
string | null

Created dataset ID

quota_info
Quota Info · object | null

Quota status information

job_id
string | null

Background job ID if processing was queued

estimated_completion_time
number | null

Estimated completion timestamp

processing_status
string | null

Status of background processing job