Skip to main content
POST
Smart Senders API: Mailbox marketplace feature. Contact support@smartlead.ai for access.

Overview

Adds mailboxes to a domain your account already bought through Smart Senders, and bills them in the same call. This is the API equivalent of adding mailboxes to an existing domain in the app. Behavior:
  • No new order. The mailboxes join the order the domain was bought under, and the response’s order_id is that order.
  • Billed on the domain’s mailbox subscription. Its quantity goes up by the number of mailboxes added, at the rate the domain’s existing mailboxes are on. The prorated amount for the rest of the current billing period is added to your next invoice and paid with the card on file. Nothing is charged at call time, the renewal date does not change, and the request takes no card or payment token.
  • Delivered later. The mailboxes are created after the call returns and are usable once delivered, as with any Smart Senders purchase.
  • Safe to retry. Resending the identical request never bills twice. See Retries.

Requirements

Account. Any API key authenticates, but only accounts enabled for purchases over the API can buy. Other accounts get 403 API_PURCHASE_NOT_ENABLED and are not charged. To be enabled, contact support@smartlead.ai. Domain. The domain must be:
  • On your account, under the order you name in order_id
  • A ZapMail domain that is not pre-warmed. ZapMail is the only provider that can add mailboxes to a domain it already holds, and a pre-warmed domain would bill new, unwarmed mailboxes at the pre-warmed rate. ZapMail Infra domains are not supported either.
  • Live: delivered, and no longer being set up. A domain whose mailboxes were all deleted still counts, and can take new ones.
  • Still in use: not deleted, replaced, failed to set up, refunded, or scheduled for deletion as a whole domain
  • On an active mailbox subscription
Five mailboxes per domain. A domain can have at most 5 mailboxes: the ones it already has, paid or delivered, plus the ones in the request. Mailboxes scheduled for deletion count until they are deleted. A domain usually has at least one mailbox, so one request can usually add at most four. New addresses only. An address must not already exist on the domain or appear twice in the request. The address of a mailbox scheduled for deletion can’t be reused (restore that mailbox to keep it), and neither can the address of a deleted mailbox until the provider has finished removing it.

Query Parameters

string
required
API key used to authenticate and authorise the request.

Body Parameters

string
required
Name of the domain to add mailboxes to, e.g. example.com. Case and leading or trailing spaces are ignored.
string
required
ID of the order the domain was bought under: the order_id returned by Place Order, also listed with each domain by Get Purchased Domain List. Leading and trailing spaces are ignored.
object[]
required
Mailboxes to add. At least one, and no more than the domain has room for (see Requirements). Unknown fields are ignored.

Headers

string
required
Must be application/json

Response Fields

string
Always ORDER_PLACEMENT_SUCCESS on success
string
The order the domain was bought under. The mailboxes are added to this order.
object
A 201 means the mailboxes were billed and queued for creation; they are usable once delivered. If they don’t arrive, contact support@smartlead.ai rather than resending: their addresses are now taken, so a repeat request is refused with MAILBOX_ALREADY_EXISTS.

Response Codes

Created
Mailboxes billed and queued for creation
Bad Request
The request failed validation, or the domain’s provider does not support adding mailboxes. See Errors
Unauthorized
Missing or invalid API key, expired plan, or API access denied for the account
Forbidden
The account is not enabled for purchases over the API. Not charged
Not Found
No domain with that name on that order on your account, or the domain’s mailbox subscription can’t be found. Not charged
Conflict
The domain can’t take these mailboxes (its state, the five-mailbox limit, or an address clash), or another request for it is running. Not charged
Too Many Requests
Rate limited. Not charged; retry with backoff
Internal Server Error
Billing failed or its outcome is unknown (read the code and message), or an unexpected error occurred before billing (no code; not charged)
Service Unavailable
Billing is temporarily unavailable. Not charged; retry with backoff

Errors

Errors have this shape:
Branch on code. The message is written for the end customer and can be shown as it is; for billing errors it says whether the customer was charged. API key errors are the exception: they return 401 with only a message. An unexpected error returns 500 without a code, and nothing was charged.

Before billing: nothing is charged

Retrying unchanged gets the same answer, so fix the request or the account first. The exception is ADD_MAILBOXES_IN_PROGRESS, which clears on its own. When more than one of the domain conditions applies (DOMAIN_DELETED through NO_PARENT_ORDER), the first in this table is returned.

From billing

Billing can also refuse with a code of its own that is not listed here. It arrives with billing’s status when that is a 4xx, and as a 500 otherwise.
ADD_MAILBOXES_FAILED covers two outcomes, and only the message tells them apart. If it says to contact support, the charge may stand: do not retry.

Retries

Retrying is safe:
  • An identical request never bills twice. Identical means the same set of mailbox names on the same domain, in any order.
  • A changed request is fine too. Mailboxes left by an earlier attempt that was never charged are discarded and replaced by the new ones.
  • Overlapping requests are refused. Only one request per domain, and one per mailbox subscription, runs at a time. The others get 409 ADD_MAILBOXES_IN_PROGRESS and are not billed. Domains bought together in one order share a mailbox subscription, so a request for one can hold up a request for another.
Timeouts and unknown outcomes. Allow at least 60 seconds for a response. If the call times out, the connection drops, or you get ADD_MAILBOXES_STATUS_UNKNOWN, wait 5 minutes and resend the identical request: