About the Domain Assignments API

The Domain Assignments API lets you manage which domains point to the Wix sites in an account. Each domain assignment connects a domain to a site, either as the site's primary domain or as a redirect to the site's primary domain. Read more about primary and redirected domains.

With the Domain Assignments API, you can:

  • Assign a domain to a site, or move it from another site.
  • Set a domain as a site's primary domain.
  • Retrieve the domain assignments of your sites.
  • Unassign a domain from a site.

To connect a domain that isn't registered with Wix, use the Connected Domains API.

Primary and redirect domains

A domain can be assigned to 1 site at a time. A site has a single primary domain and can have up to 300 redirect domains.

Some calls change more than the domain you specify:

  • When you assign a domain as PRIMARY to a site that already has domain assignments, the site's existing domain assignments are removed, including its previous primary domain and all redirects. To keep them, assign the domain as REDIRECT, and then call Set Domain As Primary.
  • When you assign a domain as REDIRECT to a site that has no domain assignments, the domain becomes the site's primary domain.
  • When you set a domain as primary, the site's previous primary domain becomes a redirect, and all of the site's redirects point to the new primary domain.
  • When you delete the domain assignment of a site's primary domain, all of the site's domain assignments are deleted, including its redirects. To keep the redirects, first set a different domain as the site's primary domain.
  • You can't move a domain that's the primary domain of another site. First set a different domain as that site's primary domain.

Before you begin

It's important to note the following points before starting to code:

  • You must specify the Wix account ID in the wix-account-id header of every call.
  • You can assign domains only to sites with a Premium plan. Use the Resellers API to add Premium plans to your customers' sites.
  • The ID of a domain assignment is the domain name. For example, the ID of the domain assignment of mystunningsite.com is mystunningsite.com.
  • You can specify the site in the siteInfo.id field or in the request header. If you specify it in both places, the site IDs must be identical.

Use cases

Terminology

  • Domain assignment: The connection between a domain and a Wix site.
  • Primary domain: The domain that visitors see when they visit the site. A site has a single primary domain.
  • Redirect domain: A domain that sends visitors to the site's primary domain.

Last updated: 1 November 2026

Did this help?