Delivery

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
  1. The Delivery line object
  2. delivery.search

The Delivery line object

One recipient’s line in the delivery log: who sent it, where it went and what became of it.

Attributes

  • idstring

    The line’s id.

  • atnumber

    When it happened, in milliseconds since 1970.

  • directionenum

    outbound for mail that left, inbound for mail that came.

    One ofinboundoutbound

  • sendernullable string

    Who 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.

  • recipientstring

    The address it went to.

  • vianullable string

    The group address it reached this mailbox through, if any.

  • statusenum

    What became of it for this recipient.

    One ofsentdelivereddelayedbouncedcomplainedrejectedexpiredskippedreceivedjunkblocked

  • reasonnullable string

    Why, in words, when the status needs saying why.

  • messagestringoptional

    Mailset’s id for the send this line is about: the id its send answered. Present on every line of mail that left.

  • messageIdstringoptional

    The message’s Message-ID header, without the angle brackets. Present whenever message is.

  • clientnullable objectoptional

    Which client submitted the message, from the Mailset-Client header 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.

    Show child attributesHide child attributes
    • nameenum

      Which client sent it: one of Mailset’s SDKs by its language (typescript, python, go, ruby, php, java, rust), cli, web, ios, or other.

      One oftypescriptpythongorubyphpjavarustcliwebiosother

    • versionnullable string

      Its version, as it said. Null for other.

  • duplicateOfstringoptional

    Present when the same content went to this recipient from the same address less than 10 minutes before, under another Message-ID: the message of that earlier send. Both were sent. Give the send an idempotency key to stop it.

Answered by

delivery.search

The Delivery line object
{
  "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

App key with sendAdmin or owner

Parameters

  • idstringoptional

    Only the lines of one send: the id its send answered (a line’s message).

    At most 64 characters.

  • messageIdstringoptional

    Only the lines of the message with this Message-ID header, with or without its angle brackets.

    At most 998 characters.

  • senderstringoptional

    A sender’s whole address, or part of one.

    At most 254 characters.

  • recipientstringoptional

    A recipient’s whole address, or part of one.

    At most 254 characters.

  • statusenumoptional

    Only lines with this status.

    One ofsentdelivereddelayedbouncedcomplainedrejectedexpiredskippedreceivedjunkblocked

  • sinceinteger or stringoptional

    From this moment on: milliseconds, an ISO time, or a day (YYYY-MM-DD, from its start in UTC).

  • untilinteger or stringoptional

    Up to this moment: milliseconds, an ISO time, or a day (YYYY-MM-DD, to its end in UTC).

  • limitintegeroptional

    How many lines a page holds, 1 to 200.

    Default 50. From 1 to 200.

  • cursorstringoptional

    The next of the page before, for the page after it.

    At most 64 characters.

Beside input

  • orgstringoptional

    The org this is about. Needed when the caller is in more than one.

Returns

data is an object with:

  • eventsarray of Delivery line objects

    The lines found, newest first.

  • nextnullable string

    Pass back as cursor for the next page. Null at the end.

In the CLIErrors

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
Response
{
  "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"
  }
}