List Emails
curl --request GET \
--url https://api.example.com/api/v1/emailsimport requests
url = "https://api.example.com/api/v1/emails"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/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.example.com/api/v1/emails",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/api/v1/emails"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/api/v1/emails")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/emails")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"from": "<string>",
"to": [
"<string>"
],
"cc": [
"<string>"
],
"bcc": [
"<string>"
],
"subject": "<string>",
"status": "<string>",
"messageId": "<string>",
"templateId": "<string>",
"createdAt": "<string>",
"sentAt": "<string>",
"deliveredAt": "<string>",
"openedAt": "<string>",
"clickedAt": "<string>"
}
],
"pagination": {
"page": 123,
"limit": 123,
"total": 123,
"totalPages": 123
}
}Emails
List Emails
Retrieve paginated list of sent emails
GET
/
api
/
v1
/
emails
List Emails
curl --request GET \
--url https://api.example.com/api/v1/emailsimport requests
url = "https://api.example.com/api/v1/emails"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/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.example.com/api/v1/emails",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/api/v1/emails"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/api/v1/emails")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/emails")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"from": "<string>",
"to": [
"<string>"
],
"cc": [
"<string>"
],
"bcc": [
"<string>"
],
"subject": "<string>",
"status": "<string>",
"messageId": "<string>",
"templateId": "<string>",
"createdAt": "<string>",
"sentAt": "<string>",
"deliveredAt": "<string>",
"openedAt": "<string>",
"clickedAt": "<string>"
}
],
"pagination": {
"page": 123,
"limit": 123,
"total": 123,
"totalPages": 123
}
}List sent emails with optional filtering by status, recipient, date range, and more.
Query Parameters
Page number for pagination.
Number of items per page (max 100).
Filter by email status:
queued, sent, delivered, bounced, or failed.Filter by recipient email address.
Filter by sender email address.
Filter by date range start (ISO 8601 format).
Filter by date range end (ISO 8601 format).
Examples
import { MailBreeze } from "mailbreeze";
const mailbreeze = new MailBreeze({ apiKey: "sk_live_xxx" });
// List all emails
const { data, pagination } = await mailbreeze.emails.list();
console.log(`Found ${pagination.total} emails`);
// List with filters
const { data } = await mailbreeze.emails.list({
status: "delivered",
startDate: "2024-01-01T00:00:00Z",
endDate: "2024-01-31T23:59:59Z",
page: 1,
limit: 50,
});
for (const email of data) {
console.log(`${email.id}: ${email.subject} -> ${email.to.join(", ")}`);
}
from mailbreeze import MailBreeze
client = MailBreeze(api_key="sk_live_xxx")
# List all emails
result = await client.emails.list()
print(f"Found {result.pagination.total} emails")
# List with filters
result = await client.emails.list(
status="delivered",
start_date="2024-01-01T00:00:00Z",
end_date="2024-01-31T23:59:59Z",
page=1,
limit=50,
)
for email in result.data:
print(f"{email.id}: {email.subject} -> {', '.join(email.to)}")
client := mailbreeze.NewClient("sk_live_xxx")
// List all emails
result, err := client.Emails.List(ctx, nil)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Found %d emails\n", result.Pagination.Total)
// List with filters
result, err := client.Emails.List(ctx, &mailbreeze.ListEmailsParams{
Status: "delivered",
StartDate: "2024-01-01T00:00:00Z",
EndDate: "2024-01-31T23:59:59Z",
Page: 1,
Limit: 50,
})
for _, email := range result.Data {
fmt.Printf("%s: %s -> %s\n", email.ID, email.Subject, strings.Join(email.To, ", "))
}
$mailbreeze = new MailBreeze('sk_live_xxx');
// List all emails
$response = $mailbreeze->emails->list();
$result = $response['data'];
echo "Found " . $result['pagination']['total'] . " emails\n";
// List with filters
$response = $mailbreeze->emails->list([
'status' => 'delivered',
'startDate' => '2024-01-01T00:00:00Z',
'endDate' => '2024-01-31T23:59:59Z',
'page' => 1,
'limit' => 50,
]);
$result = $response['data'];
foreach ($result['emails'] as $email) {
echo $email['id'] . ": " . $email['subject'] . "\n";
}
let client = Client::new("sk_live_xxx");
// List all emails
let result = client.emails().list(None).await?;
println!("Found {} emails", result.pagination.total);
// List with filters
let result = client.emails().list(Some(ListEmailsParams {
status: Some("delivered".to_string()),
start_date: Some("2024-01-01T00:00:00Z".to_string()),
end_date: Some("2024-01-31T23:59:59Z".to_string()),
page: Some(1),
limit: Some(50),
..Default::default()
})).await?;
for email in result.data {
println!("{}: {} -> {:?}", email.id, email.subject, email.to);
}
# List all emails
curl "https://api.mailbreeze.com/api/v1/emails" \
-H "Authorization: Bearer sk_live_xxx"
# List with filters
curl "https://api.mailbreeze.com/api/v1/emails?status=delivered&page=1&limit=50" \
-H "Authorization: Bearer sk_live_xxx"
Response
Array of email objects.
Show Email object
Show Email object
Unique email ID.
Sender email address.
Recipient email addresses.
CC recipients.
BCC recipients.
Email subject line.
Current status:
queued, sent, delivered, bounced, or failed.SMTP message ID.
Template ID if sent with a template.
ISO 8601 timestamp when created.
ISO 8601 timestamp when sent.
ISO 8601 timestamp when delivered.
ISO 8601 timestamp when first opened.
ISO 8601 timestamp when first clicked.
Example Response
{
"success": true,
"data": {
"emails": [
{
"id": "msg_abc123",
"from": "hello@yourdomain.com",
"to": ["user@example.com"],
"subject": "Welcome!",
"status": "delivered",
"messageId": "abc123@mailbreeze.com",
"createdAt": "2024-01-15T10:30:00Z",
"sentAt": "2024-01-15T10:30:01Z",
"deliveredAt": "2024-01-15T10:30:05Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 150,
"totalPages": 8
}
},
"meta": {
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_abc123",
"path": "/api/v1/emails"
}
}
⌘I