GET/api/v1/delivery-notes/{uuid}/emails

Get Email History

Returns the complete history of emails sent for a specific delivery note, ordered by sent date (newest first).

Headers

NameTypeRequiredDescription
AuthorizationstringYesBearer token for authentication
X-CompanystringYesCompany UUID to scope the request

Path Parameters

NameTypeRequiredDescription
uuidstringYesThe UUID of the delivery note

Request

cURL
curl https://api.storno.ro/api/v1/delivery-notes/950e8400-e29b-41d4-a716-446655440000/emails \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "X-Company: company-uuid-here"
JavaScript
const response = await fetch('https://api.storno.ro/api/v1/delivery-notes/950e8400-e29b-41d4-a716-446655440000/emails', {
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'X-Company': 'company-uuid-here'
  }
});

const emailHistory = await response.json();

emailHistory.forEach(entry => {
  console.log(`Sent to ${entry.to} on ${entry.sentAt}: ${entry.deliveryStatus}`);
});

Response

Returns an array of email log entries:

[
  {
    "id": "8f9a0b1c-2d3e-4f5a-6b7c-8d9e0f1a2b3c",
    "to": "[email protected]",
    "cc": ["[email protected]"],
    "bcc": null,
    "subject": "Aviz de livrare DN-2026-012",
    "attachments": ["aviz-DN-2026-012.pdf"],
    "sentAt": "2026-02-18T14:35:00Z",
    "deliveryStatus": "delivered",
    "openedAt": "2026-02-18T15:10:00Z",
    "bouncedAt": null,
    "bounceReason": null,
    "sentBy": {
      "id": "5e6f7a8b-9c0d-1e2f-3a4b-5c6d7e8f9a0b",
      "name": "John Doe",
      "email": "[email protected]"
    }
  },
  {
    "id": "7e8f9a0b-1c2d-3e4f-5a6b-7c8d9e0f1a2b",
    "to": "[email protected]",
    "cc": null,
    "bcc": null,
    "subject": "Aviz de livrare DN-2026-012",
    "attachments": ["aviz-DN-2026-012.pdf"],
    "sentAt": "2026-02-18T09:00:00Z",
    "deliveryStatus": "bounced",
    "openedAt": null,
    "bouncedAt": "2026-02-18T09:01:00Z",
    "bounceReason": "Mailbox does not exist",
    "sentBy": {
      "id": "5e6f7a8b-9c0d-1e2f-3a4b-5c6d7e8f9a0b",
      "name": "John Doe",
      "email": "[email protected]"
    }
  }
]

Email Record Fields

FieldTypeDescription
idstringEmail log UUID
tostringPrimary recipient email address
ccstring[]|nullCC recipients
bccstring[]|nullBCC recipients
subjectstringEmail subject line
attachmentsstring[]List of attached file names
sentAtstringISO 8601 timestamp when email was sent
deliveryStatusstringCurrent delivery status (see values below)
openedAtstring|nullWhen the email was first opened
bouncedAtstring|nullWhen the email bounced
bounceReasonstring|nullReason for bounce
sentByobjectUser who triggered the send

Delivery Status Values

StatusDescription
queuedEmail is queued for sending
sentSent to recipient's mail server
deliveredDelivered to recipient's inbox
openedEmail was opened by recipient
bouncedEmail bounced (hard or soft)
failedEmail sending failed

Error Codes

Status CodeError CodeDescription
401unauthorizedMissing or invalid authentication token
403forbiddenInvalid or missing X-Company header
404not_foundDelivery note not found or doesn't belong to the company