v1 is deprecated. Please move to API v2 (recommended). v1 keeps working until March 31, 2027, then it stops. See Moving from v1.

Domain changes

Replace a domain

Ask for a domain to be replaced by another one. When our team has finished, the new domain takes over the old one's place on your order: its mailboxes (with the new domain in their addresses) and its redirect or masking.

POSThttps://server.scaledmail.com/api/v1/swap-domain/:old_domain
Token access
Read and write
Rate limit
40 write calls per minute per token

This call does not change anything by itself. It opens a change request and answers as soon as the request is saved. You can follow the request, or cancel it while it is still Pending, under Infrastructure › Domain updates in the app. There is no API call to read or cancel a request.

Our team carries out a domain change by hand (DNS, new mailboxes at Google or Microsoft). When it is done, GET /domains shows the new domain. A domain bought from us that you swap out goes back to your unused purchased domains; a domain of your own is released.

Only one open request of each kind per domain: a domain change, a sender name change, and a redirect or masking change (these two share one slot). Another request of the same kind answers 409. Changes are free.

Path parameters

  • old_domainstringrequiredat most 253 characters

    A domain of this workspace, like demo-domain-1.com. Case is ignored. Domains that are being cancelled (alone or with their whole order), expired or released are not found, and neither are domains you only point to us for masking.

Headers

  • Authorizationstringrequired

    Bearer <your API token>. The token needs Read and write access.

Query parameters

  • organization_idstringrequired

    Your workspace id (org_...). Must be a workspace this token was made for.

  • providerenumrequired

    Where the new domain comes from. scaledmail: a domain you bought from us that is not in use yet (see GET /purchased-domains?available=true). other: a domain you own at another registrar. Case is ignored.

    One of: scaledmail other

Body

  • new_domainstringrequiredat most 253 characters

    The domain that takes over, like demo-domain-2.com. A main domain only (no subdomain like mail.demo-domain-2.com; demo-domain-2.co.uk is fine). It must not already be in use at ScaledMail.

  • hostingobjectoptional

    Only with provider=other, and optional there: the login of the registrar that holds the new domain, so our team can set up its DNS. It is saved with your workspace's registrar logins before the request is opened, so it stays saved even if the request is then refused. Not allowed with provider=scaledmail.

    Show child fields
    • providerenumrequired

      Where the new domain is registered. Case is ignored.

      One of: Porkbun Namecheap Godaddy HostGator Bigrock Spaceship Dynadot Ionos Cloudflare DnSimple Scaledmail Other

    • usernamestringrequired1 to 254 characters

      Login of that registrar account.

    • passwordstringrequired1 to 500 characters

      Password of that registrar account.

    • linkstringoptional1 to 500 characters

      Login page of the registrar. Must not be empty when sent.

    • api_keystringoptionalat most 500 characters

      The registrar's API key, if you have one.

    • api_secretstringoptionalat most 500 characters

      The API secret some registrars pair with the key.

Response (200)

  • message"Domain Swap Requested"required

    Domain Swap Requested. The request is open; nothing has changed yet.

Responses

  • 200OK. The request is open. Our team will carry it out.
  • 400No provider. The provider query parameter is missing. The text also names buy, but buy is not accepted here: a value other than scaledmail or other answers Invalid provider. Must be 'scaledmail' or 'other'.
  • 400Invalid hosting. hosting is sent with provider=scaledmail (hosting_not_allowed), or it lacks provider, username or password, has an empty link, a field that is too long, an api_key / api_secret that is not text, or a registrar not in the list (invalid_hosting).
  • 400Invalid domain. new_domain or old_domain is not a domain name, or new_domain is a subdomain.
  • 400New domain not free. With provider=scaledmail: the new domain is not one of your unused purchased domains, or another request already uses it. With provider=other the same text comes with status 409 when the domain is already in use at ScaledMail.
  • 404Domain not found. No such domain in this workspace (a domain of another workspace looks the same), or it is being cancelled.
  • 409Request already open. This domain already has an open Domain Name request. Wait until our team or our system has finished it, or cancel it in the app while it is still Pending.
  • 403Read-only token. The token has Read access only.
  • 429Too many requests. More than 30 change requests in a minute by the person who made the token (the app's requests count too), or more than 40 write calls in a minute on this token (then the body is the rate-limit error with error: rate_limited and a Retry-After header).
  • 500Server error. Something went wrong on our side. No request was opened; try again.