JSON requests (no attachments)
When the email has no attachments, the SDK sends:Serialization rules
Undefined fields are omitted by
JSON.stringify, so the request body contains only populated values.
Example JSON body
Multipart requests (with attachments)
When one or more attachments are present, the SDK builds aFormData body and deliberately does not set Content-Type. The runtime sets the header automatically with the correct boundary.
Field mapping
Blob construction
The SDK wraps attachment content as follows:BloborFile: passed as-is. The Blob’s owntypeis used; the SDK ignorescontentTypefor Blob inputs.Uint8ArrayorArrayBuffer: wrapped in aBlobwithtypeset tocontentTypeif provided, otherwise"application/octet-stream".Buffer(Node.js): accepted because it is aUint8Arraysubclass.
Response parsing
The SDK parses every response body as JSON. If parsing fails or the body is not an object, the SDK treats it as{}.
Success detection
A response is considered successful only when all of the following are true:response.okistrue(HTTP 200-299).- The parsed body is an object.
body.success === true.
sendEmail result mapping
On success, the SDK maps the API response to aResult object:
On failure:
getEmailStatus result mapping
On success, the SDK maps the API response to anEmailStatusResult:
On failure:
Timeouts
The SDK usesAbortController with setTimeout per request. The default timeout is 30,000 ms and is configurable via the timeoutMs constructor option.
When a timeout occurs, the SDK resolves with:
statusCode is included for timeouts or network errors.
Next steps
API reference
Endpoint paths, curl examples, and parameter details.
Error codes
Full catalog of error codes and how to resolve them.
Rate limits
Plan allowances and defensive sending practices.
Troubleshooting
Fix serialization and timeout issues.