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.

POSThttps://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

  • idstringrequired

    The order id (ord_...).

Headers

  • Authorizationstringrequired

    Bearer <your API token>. Tokens start with sm_live_.

  • Workspacestringrequired

    The workspace id to act on (from GET /workspaces or Settings › API tokens). Required on every call except the /workspaces calls; without it: 400 workspace_required.

Body

  • domainsstring[]required1 to 20 items

    Domains of this order to remove, 1 to 20, by name (demo-domain-1.com, case is ignored). Duplicates count once.

Response (200)

  • idstringrequired

    The order (ord_...).

  • removed_domainsstring[]required

    The domains that leave the order, as sent.

  • cancel_atstringoptional

    The day they are removed (YYYY-MM-DD): the end of the paid period.

  • domain_countintegerrequired

    Domains that stay on the order.

  • recurring_amountnumberrequired

    What the order renews for from the next renewal, in US dollars.

Responses

  • 200OK. The domains will be removed at cancel_at.
  • 400Invalid input. domains is empty or has more than 20 entries (too_many_domains); an entry is empty or over 253 characters (validation_failed).
  • 403Not allowed. The token does not have the orders:write scope (missing_scope) or can't use this workspace (workspace_not_allowed), or the person who made the token is no longer an owner or admin of the workspace (role_not_allowed).
  • 404Not found. No order with this id in this workspace (order_not_found). An order of another workspace looks the same.
  • 409Not active. The order is already cancelling or has ended (order_not_active), is still being set up (order_in_progress), another change to it is running (order_busy: try again in a moment), or its mailboxes are on subdomains (subdomain_order: not supported in the API yet, contact support).
  • 422Can't remove. A domain is not on this order or is already cancelling (domain_not_on_order, param names it), or the list holds every remaining domain of the order (nothing_left: cancel the order instead). Also order_billed_manually. Nothing was removed.
  • 429Rate limited. More than 60 write calls in a minute with this token (rate_limited). Wait for the Retry-After seconds.
  • 500Check with us. The payment provider gave no clear answer (needs_team): our team was told and checks the order. Don't try again. server_error for an unexpected failure.
  • 503Not available. Payments are not available right now (not_available), or the server is busy (busy, with Retry-After). Nothing changed; try again later.

Like every call, it can also answer 401 (bad key), 400 workspace_required, 403 workspace_not_allowed. See Errors.