Skip to main content
After you send an email with sendEmail, use getEmailStatus to track its progress through the BosonMail system. The method queries the API for the current state and delivery status of a specific message. It always resolves, even on failure, and returns an EmailStatusResult object.

Signature

Parameters

string
required
The message identifier returned by sendEmail in Result.messageId. Must be a non-empty string after trimming.
The SDK does not validate email address format, but it does validate messageId before making a request. If messageId is empty or not a string, the method returns { success: false, errorCode: "invalid_id", errorMessage: "'messageId' must be a non-empty string" } with no network call.

Endpoint and authentication

The request includes:
  • Authorization: Bearer <apiKey>
  • Accept: application/json
The full default URL is https://webmail.bosonware.com/api/v1/emails/:id/status. The API key needs email:read or email:send scope. The exact scope requirements are documented in the BosonMail README. Contact BosonWare at support@bosonware.com to confirm which scope your key requires.

Return value

EmailStatusResult

boolean
required
true when the status was retrieved successfully. false for any validation, network, API, or timeout failure.
EmailStatusData
The status payload when success is true.
string
Human-readable description when success is false.
string
Machine-readable error code when success is false. Present only on EmailStatusResult, not on Result.
number
HTTP status code from the API response. Absent for client-side validation errors and network/timeout failures.

EmailStatusData

string | number
required
Internal BosonMail identifier.
string
UUID for the message. Defaults to "" if absent in the API response.
string
The message identifier. Defaults to "" if absent.
EmailSentStatus
required
Current email status in the BosonMail system.
EmailSentStatus
required
Delivery status reported by the API.
string | string[]
Recipient address or addresses. Defaults to "" if absent.
string
Email subject. Defaults to "" if absent.
string
ISO timestamp of when the email was created. Defaults to "" if absent.

Status values

The EmailSentStatus type is defined as:
The type is open: the BosonMail backend may return values beyond the known list. Use the values the API returns rather than assuming every message follows the same progression. The exact meaning and transition order is not documented by BosonWare. The descriptions below are general email terms and should be confirmed with BosonWare.
The exact meaning of each status value and the transition order is not documented by BosonWare. Treat the descriptions above as general guidance. Confirm behavior with support@bosonware.com.

Submission vs delivery

A successful sendEmail means the API accepted the message. The typical initial status is "queued". Delivery to the recipient’s inbox is a separate, asynchronous process that depends on the receiving server’s availability, spam filters, and network conditions. The diagram above is illustrative. Actual delivery flow may differ.

Terminal statuses

The BosonMail README treats the following as terminal: delivered, failed, bounced, rejected. A polling loop should stop when it encounters any of these. deferred and sent are not terminal; the status may change on subsequent checks.

Error results

Client-side validation

API errors

When the API returns a non-2xx response or success !== true, the SDK extracts the error code and message from the response body:

Incomplete response

If the API response lacks required fields (id, status, or delivery_status as strings), the SDK returns:

Network or timeout

Persist messageId for later lookup

Store the messageId from every successful sendEmail in your database or job queue so you can check status later without relying on in-memory state.
store-message-id.ts

Polling for updates

The SDK does not poll automatically. Implement polling in your application if you need to wait for a terminal status. A typical pattern checks every 5 seconds, up to 6 attempts (30 seconds total), and stops on terminal statuses.
poll-status.ts
For a complete guide, see Monitoring delivery.

Sending emails

Full sendEmail reference with parameters and validation rules.

Error handling

How to classify and respond to every kind of SDK error.

Guides: Monitoring delivery

Practical guide for polling, webhooks, and delivery tracking.

Client configuration

Timeout settings that affect status check requests.