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 domain masking

Change the website a masked domain shows (its primary domain). For a plain redirect, use POST /swap-redirect/:old_domain.

POSThttps://server.scaledmail.com/api/v1/swap-domain-masking/: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.

Masking changes are usually carried out by our system within minutes, without anyone on our team. If it can't do one, our team takes it over. GET /domain-masking shows the new primary domain once it is done.

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

    The masked domain, by name (demo-domain-1.com) or by its domain_id from GET /domain-masking. Domains you only point to us for masking work too.

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.

Body

  • new_primary_domainstringrequired1 to 253 characters

    The website the masked domain should show, like demo-domain-9.com. A main domain (no subdomain), not the masked domain itself. Saved in lower case.

Response (200)

  • message"Domain Masking Swap Requested"required

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

Responses

  • 200OK. The request is open.
  • 400No primary domain. new_primary_domain is missing, empty or not text.
  • 400Invalid primary domain. new_primary_domain is not a domain name. A subdomain or the masked domain itself is refused with its own text (same code). An old_domain that is neither a domain name nor an id answers Invalid domain format.
  • 400Same primary domain. The domain already shows this primary domain.
  • 404Not masked. No domain with masking by this name or id in this workspace.
  • 404Domain not found. The masked domain is being cancelled.
  • 409Request already open. This domain already has an open Domain Masking 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.