Orders
Remove domains
Remove some domains from an order. They keep working until the end of the paid period, and the next renewal bills less.
https://api.scaledmail.com/v2/orders/:id/remove-domains- Rate limit
- Write: 60 calls per minute per token
All or nothing: if one domain can't be removed, nothing is. An order keeps at least one domain; to drop all, cancel the order.
Path parameters
idstringrequiredThe order id (
ord_).. . .
Headers
AuthorizationstringrequiredBearer <your API token>. Tokens start withsm_.live_ WorkspacestringrequiredThe workspace id to act on (from
GET /workspacesor Settings › API tokens). Required on every call except the/workspacescalls; without it:400workspace_.required
Body
domainsstring[]required1 to 20 itemsDomains of this order to remove, 1 to 20, by name (
demo-domain-1., case is ignored). Duplicates count once.com
Response (200)
idstringrequiredThe order (
ord_).. . . removed_domainsstring[]requiredThe domains that leave the order, as sent.
cancel_atstringoptionalThe day they are removed (
YYYY-MM-DD): the end of the paid period.domain_countintegerrequiredDomains that stay on the order.
recurring_amountnumberrequiredWhat the order renews for from the next renewal, in US dollars.
Responses
- 200OK. The domains will be removed at
cancel_.at - 400Invalid input.
domainsis empty or has more than 20 entries (too_); an entry is empty or over 253 characters (many_ domains validation_).failed - 403Not allowed. The token does not have the
orders:writescope (missing_) or can't use this workspace (scope workspace_), or the person who made the token is no longer an owner or admin of the workspace (not_ allowed role_).not_ allowed - 404Not found. No order with this id in this workspace (
order_). An order of another workspace looks the same.not_ found - 409Not active. The order is already cancelling or has ended (
order_), is still being set up (not_ active order_), another change to it is running (in_ progress order_: try again in a moment), or its mailboxes are on subdomains (busy subdomain_: not supported in the API yet, contact support).order - 422Can't remove. A domain is not on this order or is already cancelling (
domain_,not_ on_ order paramnames it), or the list holds every remaining domain of the order (nothing_: cancel the order instead). Alsoleft order_. Nothing was removed.billed_ manually - 429Rate limited. More than 60 write calls in a minute with this token (
rate_). Wait for thelimited Retry-Afterseconds. - 500Check with us. The payment provider gave no clear answer (
needs_): our team was told and checks the order. Don't try again.team server_for an unexpected failure.error - 503Not available. Payments are not available right now (
not_), or the server is busy (available busy, withRetry-After). Nothing changed; try again later.
Like every call, it can also answer 401 (bad key), 400 workspace_, 403 workspace_. See Errors.
