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
Authorization: Bearer <apiKey>Accept: application/json
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
TheEmailSentStatus type is defined as:
Submission vs delivery
A successfulsendEmail 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 orsuccess !== 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 themessageId 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
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.