> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# GetDomainAssignment

# Package: domains

# Namespace: DomainAssignmentService

# Method link: https://dev.wix.com/docs/api-reference/account-level/domains/domain-assignments/get-domain-assignment.md

## Permission Scopes:
Manage Domains: SCOPE.ACC-DC-PREMIUM.MANAGE-DOMAINS

## Introduction

Retrieves a domain assignment.


The domain assignment ID is the domain name. For example, to retrieve the
domain assignment of `mystunningsite.com`, specify `mystunningsite.com` as
`domainAssignmentId`.

You must specify the Wix account ID in the `wix-account-id` header.

---

## REST API

### Schema

```
 Method: getDomainAssignment
 Description: Retrieves a domain assignment.   The domain assignment GUID is the domain name. For example, to retrieve the domain assignment of `mystunningsite.com`, specify `mystunningsite.com` as `domainAssignmentId`.  You must specify the Wix account GUID in the `wix-account-id` header.
 URL: https://www.wixapis.com/domains/v1/domain-assignments/{domainAssignmentId}
 Method: GET
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  domainAssignmentId
 Method parameters: 
   param name: domainAssignmentId | type:   none | required: true 
 Return type: GetDomainAssignmentResponse
  - name: domainAssignment | type: DomainAssignment | description: Retrieved domain assignment.  
     - name: id | type: string | description: Domain assignment GUID. Identical to `domain`.  | read-only: true | validation: format HOSTNAME
     - name: domain | type: string | description: Domain name, including the top-level domain. For example, `mystunningsite.com`.  | validation: format HOSTNAME
     - name: siteInfo | type: SiteInfo | description: Site the domain is assigned to, and whether the domain is the site's primary domain or a redirect.  
        - ONE-OF: 
           - name: redirectInfo | type: RedirectAssignmentInfo | description: Redirect details.  Returned only when `assignmentType` is `REDIRECT`.  | read-only: true 
              - name: primaryDomain | type: string | description: Primary domain that this domain redirects to.  | read-only: true | validation: format HOSTNAME
        - name: id | type: string | description: GUID of the site the domain is assigned to.  Required unless the request header specifies the site GUID. If you specify the site GUID in both places, the GUIDs must be identical.  | validation: format GUID
        - name: assignmentType | type: AssignmentType | description: Whether the domain is the site's primary domain or a redirect to the site's primary domain.  
             - enum:
             -     PRIMARY: Site's primary domain. Visitors who enter this domain reach the site directly.
             -     REDIRECT: Domain that redirects visitors to the site's primary domain. A site can have up to 300 redirect domains.
     - name: createdDate | type: string | description: Date and time the domain assignment was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the domain assignment was last updated.  | read-only: true | validation: format date-time


```

### Examples

### Retrieve a domain assignment
Retrieves the domain assignment of a site's primary domain.

```curl
curl -X GET \
'https://www.wixapis.com/domains/v1/domain-assignments/mystunningsite.com' \
-H 'wix-account-id: <ACCOUNT_ID>' \
-H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.domains.domainAssignments.getDomainAssignment(domainAssignmentId)
 Description: Retrieves a domain assignment.   The domain assignment GUID is the domain name. For example, to retrieve the domain assignment of `mystunningsite.com`, specify `mystunningsite.com` as `domainAssignmentId`.  You must specify the Wix account GUID in the `wix-account-id` header.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  domainAssignmentId
 Method parameters: 
   param name: domainAssignmentId | type: string | description: GUID of the domain assignment to retrieve. Identical to the domain name. | required: true | validation: format HOSTNAME
 Return type: PROMISE<DomainAssignment>
  - name: _id | type: string | description: Domain assignment GUID. Identical to `domain`.  | read-only: true | validation: format HOSTNAME
  - name: domain | type: string | description: Domain name, including the top-level domain. For example, `mystunningsite.com`.  | validation: format HOSTNAME
  - name: siteInfo | type: SiteInfo | description: Site the domain is assigned to, and whether the domain is the site's primary domain or a redirect.  
     - ONE-OF: 
        - name: redirectInfo | type: RedirectAssignmentInfo | description: Redirect details.  Returned only when `assignmentType` is `REDIRECT`.  | read-only: true 
           - name: primaryDomain | type: string | description: Primary domain that this domain redirects to.  | read-only: true | validation: format HOSTNAME
     - name: _id | type: string | description: GUID of the site the domain is assigned to.  Required unless the request header specifies the site GUID. If you specify the site GUID in both places, the GUIDs must be identical.  | validation: format GUID
     - name: assignmentType | type: AssignmentType | description: Whether the domain is the site's primary domain or a redirect to the site's primary domain.  
         - enum:
         -     PRIMARY: Site's primary domain. Visitors who enter this domain reach the site directly.
         -     REDIRECT: Domain that redirects visitors to the site's primary domain. A site can have up to 300 redirect domains.
  - name: _createdDate | type: Date | description: Date and time the domain assignment was created.  | read-only: true 
  - name: _updatedDate | type: Date | description: Date and time the domain assignment was last updated.  | read-only: true 


```

### Examples

### Retrieve a domain assignment
Retrieves the domain assignment of a site's primary domain.

```javascript
import { domainAssignments } from "@wix/domains";

async function getDomainAssignment() {
  const response =
    await domainAssignments.getDomainAssignment("mystunningsite.com");
}

/* Promise resolves to:
 * {
 *   "_id": "mystunningsite.com",
 *   "domain": "mystunningsite.com",
 *   "siteInfo": {
 *     "id": "d7a341c4-196b-46e7-813c-2b0fc1847ec6",
 *     "assignmentType": "PRIMARY"
 *   },
 *   "_createdDate": "2026-10-12T08:15:42.000Z",
 *   "_updatedDate": "2026-10-12T08:15:42.000Z"
 * }
 */

```

### getDomainAssignment (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { domainAssignments } from '@wix/domains';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { domainAssignments },
  // Include the auth strategy and host as relevant
});


async function getDomainAssignment(domainAssignmentId) {
  const response = await myWixClient.domainAssignments.getDomainAssignment(domainAssignmentId);
};
```

---