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

Update sender name

Ask for new sender names on all mailboxes of a domain, and if you like new addresses made from those names. Cancelled mailboxes are left out.

POSThttps://server.scaledmail.com/api/v1/swap-sender-name/: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 changes the names (and addresses) at Google or Microsoft by hand. When it is done, GET /mailboxes/:domain shows the new names and addresses.

In name_and_alias mode, accents are made plain and other characters dropped (José O'Neil gives jose.oneil). If two names would give the same address, or a name can't give enough addresses for its block, the call is refused: try other names or fewer of them.

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.

  • modeenumrequired

    name_only: change the sender names, keep every address. name_and_alias: change the names and give each mailbox a new address made from its new name (jane.doe, janedoe, jane_doe, j.doe ...).

    One of: name_only name_and_alias

Body

  • sender_namesobject[]required1 to 100 items

    The new senders, 1 to 100, and never more than the domain has mailboxes. The mailboxes (oldest first) are split into blocks of mailboxes ÷ names, rounded up, one block per sender in order: with 4 mailboxes and 2 names, the first 2 get name 1 and the last 2 get name 2. Because of the rounding, the last names can get a smaller block or none at all: with 4 mailboxes and 3 names, the blocks are 2, 2 and 0, so the third name is not used.

    Show child fields
    • first_namestringrequired1 to 60 characters

      First name. Up to 60 characters after spaces at the ends are removed.

    • last_namestringrequired1 to 60 characters

      Last name. Up to 60 characters after spaces at the ends are removed.

Response (200)

  • message"Sender Name Swap Requested"required

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

Responses

  • 200OK. The request is open. Our team will carry it out.
  • 400Invalid domain. old_domain is not a domain name (no www., letters, digits and hyphens, an ending of 2 or more letters).
  • 400No mode. mode is missing or not name_only / name_and_alias.
  • 400Invalid names. sender_names is missing or empty, has more than 100 entries, or an entry has an empty or too long first_name / last_name.
  • 400Too many names. More names than the domain has mailboxes. A domain with no mailboxes answers no_mailboxes instead.
  • 400Addresses can't be made. In name_and_alias mode: a name can't give enough different addresses for its block, or two names give the same address.
  • 400Nothing to change. A mailbox would keep both its name and its address. Every mailbox of the domain is part of the request, so check names already in use.
  • 409Address taken. In name_and_alias mode: a new address is the current address of another mailbox on this domain.
  • 404Domain not found. No such domain in this workspace (a domain of another workspace looks the same), or it is being cancelled.
  • 404Mailbox gone. A mailbox of the domain was cancelled while the request was being made. Try again.
  • 409Request already open. This domain already has an open Sender Names 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.