Emails
List Sent Emails
List all sent emails with pagination.
GET
/
emails
List Sent Emails
curl --request GET \
--url https://api.unosend.co/emails \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.unosend.co/emails"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.unosend.co/emails', 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/emails",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.unosend.co/emails"
req, _ := http.NewRequest("GET", url, nil)
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.get("https://api.unosend.co/emails")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.unosend.co/emails")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": [
{
"id": "<string>",
"from": "<string>",
"to": [
"<string>"
],
"subject": "<string>",
"status": "<string>",
"created_at": "<string>"
}
],
"meta": {
"total": 123,
"page": 123,
"page_size": 123,
"pages": 123
}
}Page number.
Number of emails per page (max 100).
Filter by status:
queued, sent, delivered, bounced, complained.Request
curl "https://api.unosend.co/emails?page=1&per_page=10" \
-H "Authorization: Bearer un_xxxxxxxxxx"
const response = await fetch('https://api.unosend.co/emails?page=1&per_page=10', {
headers: { 'Authorization': 'Bearer un_xxxxxxxxxx' }
});
const data = await response.json();
import requests
response = requests.get('https://api.unosend.co/emails',
headers={'Authorization': 'Bearer un_xxxxxxxxxx'},
params={'page': 1, 'per_page': 10}
)
data = response.json()
req, _ := http.NewRequest("GET", "https://api.unosend.co/emails?page=1&per_page=10", nil)
req.Header.Set("Authorization", "Bearer un_xxxxxxxxxx")
resp, _ := http.DefaultClient.Do(req)
$ch = curl_init('https://api.unosend.co/emails?page=1&per_page=10');
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => ['Authorization: Bearer un_xxxxxxxxxx'],
CURLOPT_RETURNTRANSFER => true
]);
$response = curl_exec($ch);
require 'net/http'
uri = URI('https://api.unosend.co/emails?page=1&per_page=10')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = 'Bearer un_xxxxxxxxxx'
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
Response
200
{
"success": true,
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"from": "hello@yourdomain.com",
"to": ["user@example.com"],
"subject": "Hello World",
"status": "delivered",
"created_at": "2024-01-15T10:30:00.000Z"
}
],
"meta": {
"total": 42,
"page": 1,
"page_size": 10,
"pages": 5
}
}
Whether the request was successful.
Previous
Upload FileUpload a file to the cache for use as an attachment or inline image across multiple emails.
Next
⌘I
List Sent Emails
curl --request GET \
--url https://api.unosend.co/emails \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.unosend.co/emails"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.unosend.co/emails', 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/emails",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.unosend.co/emails"
req, _ := http.NewRequest("GET", url, nil)
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.get("https://api.unosend.co/emails")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.unosend.co/emails")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": [
{
"id": "<string>",
"from": "<string>",
"to": [
"<string>"
],
"subject": "<string>",
"status": "<string>",
"created_at": "<string>"
}
],
"meta": {
"total": 123,
"page": 123,
"page_size": 123,
"pages": 123
}
}