Skip to Content

Add a verified recipient.

Names an outside address and mails it a link to a page whose Confirm button makes it a verified recipient of this account; the link works for seven days, and opening it changes nothing on its own. Posting a pending address again mails a fresh link, at most once a minute. Posting a verified address answers 200 with sent: false and mails nothing. A refusal of the mail that concerns the address itself (its server refused it, or it is suppressed) is answered exactly as a sent link is. Reachable by the account's own key or a system key.

openemail.verifiedRecipients.add(
  accountId: string,
  body: VerifiedRecipientsAddBody,
  options?: CallOptions,
): ApiPromise<VerifiedRecipientAdded>

It calls POST /accounts/{accountId}/verified-recipients: Add a verified recipient in the API reference.

Example

const verifiedRecipientAdded = await openemail.verifiedRecipients.add(accountId, { address: 'ada@example.com' })

Arguments

ArgumentTypeDescription
accountIdstringAccount ULID identifier. The path's {accountId}.
bodyVerifiedRecipientsAddBodyThe 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, VerifiedRecipientAdded. It is an ApiPromise: .withResponse() gives the same with the Response it came in, for its headers.

Errors

StatusWhat it means
400validation_failed, when the address is not one; or always_verified, carrying domain, when the address is on one of this account's own domains, which are always verified recipients and are never stored
401unauthorized: the bearer credential is missing, malformed, expired, or revoked. Carries a WWW-Authenticate: Bearer challenge
404not_found: the account does not exist or is not accessible to this principal
409recipient_limit_reached, carrying limit: the account holds 100 addresses, pending and verified together, so remove one first; or pending_limit_reached, carrying limit: 10 addresses are awaiting their owners' answer, so wait for one, or remove one. A pending address whose newest link has expired no longer counts
413too_large: JSON request body exceeds 1 MiB or 500,000 values (object keys included), checked before parsing
429resend_cooldown, with Retry-After and retryAfterSeconds: a link was mailed to this address less than a minute ago; or confirmation_limit_reached, with Retry-After, retryAfterSeconds and limit: the account has mailed its 20 confirmation links for this UTC day; or rate_limited, with Retry-After: too many links from this account, or to this address, in the last minute. The last is deliberately one answer for both, since the budget per address is shared across the deployment
503recipient_verification_unavailable, with Retry-After: domain ownership is being removed and has not settled, so retry; or recipient_mail_unavailable: the link could not be mailed for a reason on the platform's side (the mail binding or the link key is unconfigured, the platform's hourly cap on its own mail is spent, or the sending service refused the message), so nothing is stored and the request may be retried. Or temporary_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

VerifiedRecipientsAddBody

/** The body of `verifiedRecipients.add`. */
type VerifiedRecipientsAddBody = {
  /** The outside address to verify */
  address: string
}

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