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 redirect

Set, change or remove the web address a domain redirects to. For a domain that uses domain masking, use POST /swap-domain-masking/:old_domain instead.

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

Redirect 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. The redirect is saved without https://, without a slash at the end and in lower case, so GET /domains shows demo-domain-9.com/page.

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.

Body

  • new_redirectstring | nullrequired

    Where visitors of the domain should go, like demo-domain-9.com/page. https:// (or http://) is optional; without it at most 253 characters. Send "" or null to remove the redirect. The field itself is required.

Response (200)

  • message"Redirect Swap Requested"required

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

Responses

  • 200OK. The request is open.
  • 400No redirect field. The body has no new_redirect field.
  • 400Invalid domain. old_domain is not a domain name (no www., letters, digits and hyphens, an ending of 2 or more letters).
  • 400Invalid redirect. new_redirect is not a web address like demo-domain-9.com or demo-domain-9.com/page, or is longer than 253 characters without https://.
  • 400Same redirect. The domain already redirects to this address (compared without https:// and a slash at the end, case ignored), or you remove a redirect the domain does not have.
  • 400Uses masking. The domain uses domain masking, not a plain redirect.
  • 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 Redirect URL 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.