Emails
Export Logs
Export email logs, bounce reports, or delivery data as downloadable files.
POST
/
v1
/
exports
Export Logs
curl --request POST \
--url https://api.unosend.co/v1/exports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "<string>",
"from_date": "<string>",
"to_date": "<string>",
"domain": "<string>"
}
'import requests
url = "https://api.unosend.co/v1/exports"
payload = {
"type": "<string>",
"from_date": "<string>",
"to_date": "<string>",
"domain": "<string>"
}
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({
type: '<string>',
from_date: '<string>',
to_date: '<string>',
domain: '<string>'
})
};
fetch('https://api.unosend.co/v1/exports', 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.unosend.co/v1/exports",
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([
'type' => '<string>',
'from_date' => '<string>',
'to_date' => '<string>',
'domain' => '<string>'
]),
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.unosend.co/v1/exports"
payload := strings.NewReader("{\n \"type\": \"<string>\",\n \"from_date\": \"<string>\",\n \"to_date\": \"<string>\",\n \"domain\": \"<string>\"\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.unosend.co/v1/exports")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"<string>\",\n \"from_date\": \"<string>\",\n \"to_date\": \"<string>\",\n \"domain\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.unosend.co/v1/exports")
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 \"type\": \"<string>\",\n \"from_date\": \"<string>\",\n \"to_date\": \"<string>\",\n \"domain\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyCreate an export job to download email delivery data in CSV format.
string
required
Type of export:
email_logs, bounces, suppressions, or opens.string
required
Start date in ISO 8601 format.
string
required
End date in ISO 8601 format.
string
Filter by sending domain. Optional.
Request
cURL
curl -X POST https://api.unosend.co/v1/exports \
-H "Authorization: Bearer un_xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"type": "email_logs",
"from_date": "2026-01-01T00:00:00Z",
"to_date": "2026-01-31T23:59:59Z"
}'
Response
202
{
"message": "Export job created",
"data": {
"export_id": "exp_abc123",
"type": "email_logs",
"status": "processing",
"created_at": "2026-01-15T10:30:00.000Z"
}
}
List Exports
Fetch all export jobs and their statuses.cURL
curl -X GET https://api.unosend.co/v1/exports \
-H "Authorization: Bearer un_xxxxxxxxxx"
Response
200
{
"data": [
{
"export_id": "exp_abc123",
"type": "email_logs",
"status": "completed",
"download_url": "https://api.unosend.co/v1/exports/exp_abc123/download",
"created_at": "2026-01-15T10:30:00.000Z",
"expires_at": "2026-01-22T10:30:00.000Z"
}
]
}
Download Export
Download a completed export file.cURL
curl -X GET https://api.unosend.co/v1/exports/exp_abc123/download \
-H "Authorization: Bearer un_xxxxxxxxxx" \
-o email_logs.csv
Export download links expire after 7 days. Create a new export if the link has expired.
Delete Export
Delete one or more completed exports.cURL
curl -X DELETE "https://api.unosend.co/v1/exports?export_ids=exp_abc123,exp_def456" \
-H "Authorization: Bearer un_xxxxxxxxxx"
Response
200
{
"message": "Exports deleted",
"deleted": ["exp_abc123", "exp_def456"]
}
⌘I
Export Logs
curl --request POST \
--url https://api.unosend.co/v1/exports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "<string>",
"from_date": "<string>",
"to_date": "<string>",
"domain": "<string>"
}
'import requests
url = "https://api.unosend.co/v1/exports"
payload = {
"type": "<string>",
"from_date": "<string>",
"to_date": "<string>",
"domain": "<string>"
}
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({
type: '<string>',
from_date: '<string>',
to_date: '<string>',
domain: '<string>'
})
};
fetch('https://api.unosend.co/v1/exports', 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.unosend.co/v1/exports",
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([
'type' => '<string>',
'from_date' => '<string>',
'to_date' => '<string>',
'domain' => '<string>'
]),
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.unosend.co/v1/exports"
payload := strings.NewReader("{\n \"type\": \"<string>\",\n \"from_date\": \"<string>\",\n \"to_date\": \"<string>\",\n \"domain\": \"<string>\"\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.unosend.co/v1/exports")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"<string>\",\n \"from_date\": \"<string>\",\n \"to_date\": \"<string>\",\n \"domain\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.unosend.co/v1/exports")
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 \"type\": \"<string>\",\n \"from_date\": \"<string>\",\n \"to_date\": \"<string>\",\n \"domain\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body