Skip to main content
GET
/
api
/
v1
/
emails
List Emails
curl --request GET \
  --url https://api.example.com/api/v1/emails
import 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
integer
default:"1"
Page number for pagination.
limit
integer
default:"20"
Number of items per page (max 100).
status
string
Filter by email status: queued, sent, delivered, bounced, or failed.
to
string
Filter by recipient email address.
from
string
Filter by sender email address.
startDate
string
Filter by date range start (ISO 8601 format).
endDate
string
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

data
array
Array of email objects.
pagination
object
Pagination metadata.
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"
  }
}