Skip to Content

Check whether a mailbox may send from an address.

Checks one From address through the same routing, ownership, credential scope and sending-state authorization as submission, including aliases, subaddresses and catch-all patterns. Requires submission access to the named mailbox; folder grants do not confer sending rights. For non-system callers, unknown or foreign addresses return 403 sender_not_owned without revealing their owner. Does not create mail, reserve quota or send anything. A successful check is advisory: submission always checks again. Responses are not cacheable.

openemail.mailboxes.checkSendAs(
  mailboxId: string,
  body: MailboxesCheckSendAsBody,
  options?: CallOptions,
): ApiPromise<SenderCheck>

It calls POST /mailboxes/{mailboxId}/send-as/check: Check whether a mailbox may send from an address in the API reference.

Example

const senderCheck = await openemail.mailboxes.checkSendAs(mailboxId, { address: 'ada@example.com' })

Arguments

ArgumentTypeDescription
mailboxIdstringMailbox ULID identifier. The path's {mailboxId}.
bodyMailboxesCheckSendAsBodyThe request's body.

Options

It takes no options of its own. Every call also takes signal, timeout, retry and headers, which say how that one call is sent (call options).

Answer

Awaited, it is the API's JSON, SenderCheck. It is an ApiPromise: .withResponse() gives the same with the Response it came in, for its headers.

Errors

StatusWhat it means
400Malformed address (invalid_address) or request body
401unauthorized: the bearer credential is missing, malformed, expired, or revoked. Carries a WWW-Authenticate: Bearer challenge
403Address not owned by this mailbox (sender_not_owned), no local sender for a system caller (sender_not_local), sending disabled (sending_disabled), or insufficient credential scope (credential_scope)
404Mailbox not found or not accessible to this principal
413too_large: JSON request body exceeds 1 MiB or 500,000 values (object keys included), checked before parsing
429Sending paused (sending_paused); Retry-After and retryAfterSeconds indicate when to retry
503temporary_failure: the platform's storage could not answer just now; retry after the Retry-After window. Any operation can answer this. A write that got it may have been applied, so retry it with the same idempotency key where it takes one, or read the state back first (see Transient failures in the API description)

A failed call rejects with a RequestError: its status, and its code, the API's error. Decide on the code: one status covers several.

Types

MailboxesCheckSendAsBody

/** The body of `mailboxes.checkSendAs`. */
type MailboxesCheckSendAsBody = {
  /** One bare From address, without a display name */
  address: string
}

It names these types of the API, each on a page of its own: SenderCheck.