> 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

# ListUrlMappings

# Package: seo

# Namespace: UrlMappingReaderService

# Method link: https://dev.wix.com/docs/api-reference/business-management/seo/url-mapping-v1/list-url-mappings.md

## Permission Scopes:
View google ads campaigns: SCOPE.PROMOTE.VIEW-GOOGLE-ADS

## Introduction

Retrieves all URL mappings on a site.

Returns an empty list when the site has no URL mappings.

---

## REST API

### Schema

```
 Method: listUrlMappings
 Description: Retrieves all URL mappings on a site.  Returns an empty list when the site has no URL mappings.
 URL: https://www.wixapis.com/promote/url-mapper/reader/v1/url-mappings
 Method: GET
 Return type: ListUrlMappingsResponse
  - name: urlMappingsEntities | type: array<UrlMappingsSchema> | description: URL mappings on the site, in a single group. Empty when the site has none.  
     - name: urlMappings | type: array<UrlMapping> | description: URL mappings on the site. Ignore keys that aren't documented.  
        - name: key | type: string | description: Type of item page this URL mapping applies to, and the variables its `mapping` must use: + `wix.stores.sub_pages.product`: Stores product page. Variables: `slug`. + `wix.blog.sub_pages.post`: Blog post page. Variables: `slug`. + `wix.blog.sub_pages.category`: Blog category page. Variables: `slug`. + `wix.bookings.sub_pages.service_page`: Bookings service page. Variables: `slug`. + `wix.online_programs.sub_pages.online_program`: Online Programs program page. Variables: `slug`. + `wix.forum.sub_pages.category`: Forum category page. Variables: `slug`. + `wix.forum.sub_pages.post`: Forum post page. Variables: `categorySlug`, `postSlug`. + `wix.groups.sub_pages.group`: Groups group page. Variables: `groupId`, `tabName`.  Other values aren't supported.  
        - name: mapping | type: string | description: URL pattern for the item pages, relative to the site's base URL. Wrap variables in double curly braces, for example `shoes/{{slug}}`. The pattern must use every variable listed for its `key`, and no others. The pattern is saved in lowercase.  Rules: up to 1,000 characters; no spaces, emoji, or URL-reserved characters; no leading or trailing slash; no empty segments; at most one variable per segment. The resulting URLs can't collide with another page on the site or with another URL mapping.  


```

### Examples

### List all URL mappings on a site
Returns the site's URL mappings in a single group. When the site has none, `urlMappingsEntities` is empty.

```curl
curl -X GET \
'https://www.wixapis.com/url-mapper/reader/v1/url-mappings' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.seo.urlMappings.listUrlMappings()
 Description: Retrieves all URL mappings on a site.  Returns an empty list when the site has no URL mappings.
 Return type: PROMISE<ListUrlMappingsResponse>
  - name: urlMappingsEntities | type: array<UrlMappingsSchema> | description: URL mappings on the site, in a single group. Empty when the site has none.  
     - name: urlMappings | type: array<UrlMapping> | description: URL mappings on the site. Ignore keys that aren't documented.  
        - name: key | type: string | description: Type of item page this URL mapping applies to, and the variables its `mapping` must use: + `wix.stores.sub_pages.product`: Stores product page. Variables: `slug`. + `wix.blog.sub_pages.post`: Blog post page. Variables: `slug`. + `wix.blog.sub_pages.category`: Blog category page. Variables: `slug`. + `wix.bookings.sub_pages.service_page`: Bookings service page. Variables: `slug`. + `wix.online_programs.sub_pages.online_program`: Online Programs program page. Variables: `slug`. + `wix.forum.sub_pages.category`: Forum category page. Variables: `slug`. + `wix.forum.sub_pages.post`: Forum post page. Variables: `categorySlug`, `postSlug`. + `wix.groups.sub_pages.group`: Groups group page. Variables: `groupId`, `tabName`.  Other values aren't supported.  
        - name: mapping | type: string | description: URL pattern for the item pages, relative to the site's base URL. Wrap variables in double curly braces, for example `shoes/{{slug}}`. The pattern must use every variable listed for its `key`, and no others. The pattern is saved in lowercase.  Rules: up to 1,000 characters; no spaces, emoji, or URL-reserved characters; no leading or trailing slash; no empty segments; at most one variable per segment. The resulting URLs can't collide with another page on the site or with another URL mapping.  


```

### Examples

### listUrlMappings
```javascript
import { urlMappings } from '@wix/seo';

async function listUrlMappings() {
  const response = await urlMappings.listUrlMappings();
};
```

### listUrlMappings (with elevated permissions)
```javascript
import { urlMappings } from '@wix/seo';
import { auth } from '@wix/essentials';

async function myListUrlMappingsMethod() {
  const elevatedListUrlMappings = auth.elevate(urlMappings.listUrlMappings);
  const response = await elevatedListUrlMappings();
}
```

### listUrlMappings (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 { urlMappings } from '@wix/seo';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

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


async function listUrlMappings() {
  const response = await myWixClient.urlMappings.listUrlMappings();
};
```

---