Delivery
Find what became of a message, recipient by recipient.
An SDK signs every request with your key: Authentication. To sign one yourself, see Calling the API without an SDK.
On this page
The Delivery line object
One recipient’s line in the delivery log: who sent it, where it went and what became of it.
Attributes
The line’s id.
When it happened, in milliseconds since 1970.
outboundfor mail that left,inboundfor mail that came.One of
inboundoutboundWho sent it. For mail that left, the mailbox it left from, whichever of its addresses was in From. For a domain key’s mail, the address it went as.
The address it went to.
The group address it reached this mailbox through, if any.
What became of it for this recipient.
One of
sentdelivereddelayedbouncedcomplainedrejectedexpiredskippedreceivedjunkblockedWhy, in words, when the status needs saying why.
Mailset’s id for the send this line is about: the
idits send answered. Present on every line of mail that left.The message’s Message-ID header, without the angle brackets. Present whenever
messageis.Which client submitted the message, from the
Mailset-Clientheader it sent: one of Mailset’s SDKs, the CLI, the web app or the iPhone app. Null for mail that came in, and for a send whose request named no client.Present when the same content went to this recipient from the same address less than 10 minutes before, under another Message-ID: the
messageof that earlier send. Both were sent. Give the send an idempotency key to stop it.
Answered by
{
"id": "dlv_8d2k4m1p9q7x",
"at": 1796048940000,
"direction": "outbound",
"sender": "moc.elpmaxe@olleh",
"recipient": "gro.elpmaxe@ana",
"via": null,
"status": "bounced",
"reason": "smtp; 550 5.1.1 The email account that you tried to reach does not exist.",
"message": "out_3f9a1c0e7b2d",
"messageId": "moc.elpmaxe@85a4d2b7e0c1a9f3",
"client": {
"name": "typescript",
"version": "0.7.0"
}
}
delivery.search
Find what happened to a message, by id, sender, recipient, status, since, until.
POST/v1/delivery.search
Parameters
Only the lines of one send: the
idits send answered (a line’smessage).At most 64 characters.
Only the lines of the message with this Message-ID header, with or without its angle brackets.
At most 998 characters.
A sender’s whole address, or part of one.
At most 254 characters.
A recipient’s whole address, or part of one.
At most 254 characters.
Only lines with this status.
One of
sentdelivereddelayedbouncedcomplainedrejectedexpiredskippedreceivedjunkblockedFrom this moment on: milliseconds, an ISO time, or a day (YYYY-MM-DD, from its start in UTC).
Up to this moment: milliseconds, an ISO time, or a day (YYYY-MM-DD, to its end in UTC).
How many lines a page holds, 1 to 200.
Default
50. From 1 to 200.The
nextof the page before, for the page after it.At most 64 characters.
Beside input
The org this is about. Needed when the caller is in more than one.
Returns
data is an object with:
The lines found, newest first.
Pass back as
cursorfor the next page. Null at the end.
import { Mailset } from 'mailset';
// Reads MAILSET_KEY from the environment.
const mailset = new Mailset();
// Did Ana get her receipt?
const { lines, next } = await mailset.delivery.search({
recipient: 'gro.elpmaxe@ana',
since: '2026-11-30',
});
for (const line of lines) {
console.log(line.status, line.reason);
}
// Pass `next` back as `cursor` for the page after.
console.log(next);
from datetime import date
from mailset import Mailset
# Reads MAILSET_KEY from the environment.
mailset = Mailset()
# Did Ana get her receipt?
page = mailset.delivery.search(
{
"recipient": "gro.elpmaxe@ana",
"since": date(2026, 11, 30),
}
)
for line in page["lines"]:
print(line["status"], line["reason"])
# Pass "next" back as "cursor" for the page after.
print(page["next"])
import (
"context"
"fmt"
"log"
mailset "mailset.app/go"
)
client, err := mailset.NewClient() // reads MAILSET_KEY
if err != nil {
log.Fatal(err)
}
ctx := context.Background()
// Did Ana get her receipt?
search := &mailset.DeliverySearchParams{
Recipient: "gro.elpmaxe@ana",
Since: mailset.Day("2026-11-30"),
require 'mailset'
mailset = Mailset::Client.new
# Did Ana get her receipt?
page = mailset.delivery.search(
recipient: 'gro.elpmaxe@ana',
since: '2026-11-30'
)
page.lines.each do |line|
puts "#{line.status} #{line.reason}"
end
# Pass page.next back as cursor: for the page after.
puts page.next
<?php
require 'vendor/autoload.php';
// Reads MAILSET_KEY from the environment.
$mailset = new Mailset\Client();
// Did Ana get her receipt?
$page = $mailset->delivery->search([
'recipient' => 'gro.elpmaxe@ana',
'since' => '2026-11-30',
]);
foreach ($page->lines as $line) {
echo $line->status, ' ', $line->reason, PHP_EOL;
}
// Pass `next` back as `cursor` for the page after.
echo $page->next, PHP_EOL;
import app.mailset.DeliveryLine;
import app.mailset.DeliveryPage;
import app.mailset.DeliverySearch;
import app.mailset.Mailset;
import java.time.LocalDate;
// Reads MAILSET_KEY from the environment.
Mailset mailset = Mailset.fromEnv();
// Did Ana get her receipt?
DeliveryPage page = mailset.delivery().search(
DeliverySearch.builder()
.recipient("gro.elpmaxe@ana")
.since(LocalDate.of(2026, 11, 30))
.build());
for (DeliveryLine line : page.lines()) {
System.out.println(line.status() + " "
+ line.reason().orElse(""));
}
// Pass next back as cursor for the page after.
page.next().ifPresent(System.out::println);
use mailset::{Client, DeliverySearch};
// Reads MAILSET_KEY from the environment.
let mailset = Client::from_env()?;
// Did Ana get her receipt?
let search = DeliverySearch::new()
.recipient("gro.elpmaxe@ana")
.since("2026-11-30");
let page = mailset.delivery().search(search).await?;
for line in &page.lines {
println!("{} {:?}", line.status, line.reason);
}
// Pass `next` back as `cursor` for the page after.
println!("{:?}", page.next);
curl https://mailset.app/v1/delivery.search \
-H "Authorization: Bearer $TOKEN" \
-H "ms-time: $MS_TIME" \
-H "ms-proof: $MS_PROOF" \
-H "Content-Type: application/json" \
-d '{"input":{"recipient":"moc.elpmaxe@ana","status":"bounced"},"org":"org_3f9a1c0e7b2d"}'
curl can’t sign a request. $TOKEN is your credential’s token, and $MS_TIME and $MS_PROOF sign this exact body: Calling the API without an SDK shows how.
mailset delivery search --recipient moc.elpmaxe@ana --status bounced
{
"ok": true,
"data": {
"events": [
{
"id": "dlv_8d2k4m1p9q7x",
"at": 1796048940000,
"direction": "outbound",
"sender": "moc.elpmaxe@olleh",
"recipient": "gro.elpmaxe@ana",
"via": null,
"status": "bounced",
"reason": "smtp; 550 5.1.1 The email account that you tried to reach does not exist.",
"message": "out_3f9a1c0e7b2d",
"messageId": "moc.elpmaxe@85a4d2b7e0c1a9f3",
"client": {
"name": "typescript",
"version": "0.7.0"
}
}
],
"next": "eyJhIjoxNzk2MDkyNDQyfQ"
}
}