Get Email
curl --request GET \
--url https://api.example.com/api/v1/emails/{id}import requests
url = "https://api.example.com/api/v1/emails/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/emails/{id}', 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/{id}",
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/{id}"
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/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/emails/{id}")
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{
"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>"
}Emails
Get Email
Retrieve details of a specific email
GET
/
api
/
v1
/
emails
/
{id}
Get Email
curl --request GET \
--url https://api.example.com/api/v1/emails/{id}import requests
url = "https://api.example.com/api/v1/emails/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/emails/{id}', 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/{id}",
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/{id}"
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/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/emails/{id}")
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{
"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>"
}Get detailed information about a specific sent email by its ID.
Path Parameters
string
required
The unique email ID (e.g.,
msg_abc123).Examples
import { MailBreeze } from "mailbreeze";
const mailbreeze = new MailBreeze({ apiKey: "sk_live_xxx" });
const email = await mailbreeze.emails.get("msg_abc123");
console.log(email.status); // "delivered"
console.log(email.subject); // "Welcome!"
console.log(email.deliveredAt); // "2024-01-15T10:30:05Z"
from mailbreeze import MailBreeze
client = MailBreeze(api_key="sk_live_xxx")
email = await client.emails.get("msg_abc123")
print(email.status) # "delivered"
print(email.subject) # "Welcome!"
print(email.delivered_at) # "2024-01-15T10:30:05Z"
client := mailbreeze.NewClient("sk_live_xxx")
email, err := client.Emails.Get(ctx, "msg_abc123")
if err != nil {
log.Fatal(err)
}
fmt.Println(email.Status) // "delivered"
fmt.Println(email.Subject) // "Welcome!"
fmt.Println(email.DeliveredAt) // "2024-01-15T10:30:05Z"
$mailbreeze = new MailBreeze('sk_live_xxx');
$result = $mailbreeze->emails->get('msg_abc123');
echo $result['email']['status']; // "delivered"
echo $result['email']['subject']; // "Welcome!"
echo $result['email']['deliveredAt']; // "2024-01-15T10:30:05Z"
let client = Client::new("sk_live_xxx");
let email = client.emails().get("msg_abc123").await?;
println!("{}", email.status); // "delivered"
println!("{}", email.subject); // "Welcome!"
println!("{:?}", email.delivered_at); // Some("2024-01-15T10:30:05Z")
curl "https://api.mailbreeze.com/api/v1/emails/msg_abc123" \
-H "Authorization: Bearer sk_live_xxx"
Response
string
Unique email ID.
string
Sender email address.
string[]
Recipient email addresses.
string[]
CC recipients.
string[]
BCC recipients.
string
Email subject line.
string
Current status:
queued, sent, delivered, bounced, or failed.string
SMTP message ID.
string
Template ID if sent with a template.
string
ISO 8601 timestamp when created.
string
ISO 8601 timestamp when sent.
string
ISO 8601 timestamp when delivered.
string
ISO 8601 timestamp when first opened (if tracking enabled).
string
ISO 8601 timestamp when first clicked (if tracking enabled).
Example Response
{
"success": true,
"data": {
"email": {
"id": "msg_abc123",
"from": "hello@yourdomain.com",
"to": ["user@example.com"],
"subject": "Welcome!",
"status": "delivered",
"messageId": "abc123@mailbreeze.com",
"templateId": "welcome-template",
"createdAt": "2024-01-15T10:30:00Z",
"sentAt": "2024-01-15T10:30:01Z",
"deliveredAt": "2024-01-15T10:30:05Z",
"openedAt": "2024-01-15T11:45:00Z",
"clickedAt": null
}
},
"meta": {
"timestamp": "2024-01-15T10:30:00.000Z",
"requestId": "req_abc123",
"path": "/api/v1/emails/msg_abc123"
}
}
Errors
| Code | HTTP Status | Description |
|---|---|---|
NOT_FOUND | 404 | Email with this ID doesn’t exist |