## Get a system page URL

`GET /v1/sites/:id/system-pages/:type/url`

Returns the public URL of the page assigned to a system role, for example to link to the cart or the customer account.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|----------|
| `id` (path) | number | yes | Site ID. List: [`GET /v1/sites`](/docs/entities/sites/list) |
| `type` (path) | string | yes | Role: `mainpage`, `catalog`, `personal`, `cart`, `order`, `payment`, `compare`, `feedback`. What each one means — [System pages](/docs/entities/sites/system-pages) |
| `scope` (query) | string | no | Internal landing scope: `KNOWLEDGE` / `GROUP` / `MAINPAGE`. Specify it if the site belongs to the corresponding scope. Otherwise `404 ENTITY_NOT_FOUND` is returned. Omit it for an ordinary site |

The method accepts no other query parameters: any other one returns `400 INVALID_PARAMS`.

## Examples

### curl — personal key

```bash
curl "https://vibecode.bitrix24.com/v1/sites/223/system-pages/personal/url" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl "https://vibecode.bitrix24.com/v1/sites/223/system-pages/personal/url" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/sites/223/system-pages/personal/url', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { success, data, error } = await res.json()

if (success) {
  console.log('Customer account:', data.url)
} else if (error.message === 'System-page binding not found') {
  console.log('Role not assigned')
} else {
  console.log('Error:', error.code, error.message)
}
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/sites/223/system-pages/personal/url', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

const { success, data } = await res.json()
```

## Response fields

| Field | Type | Description |
|------|-----|----------|
| `success` | boolean | Always `true` on success |
| `data.url` | string | Public URL of the page assigned to the role |

## Response example

```json
{
  "success": true,
  "data": {
    "url": "https://b24-y4xx51.bitrix24site.com/docs-personal/"
  }
}
```

## Error response example

404 — no page is assigned to the role:

```json
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "System-page binding not found"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|----------|
| 404 | `ENTITY_NOT_FOUND` | `System-page binding not found` — no page is assigned to the `type` role. The code is the same as for a site that is not found: tell them apart by `error.message` |
| 404 | `ENTITY_NOT_FOUND` | `Entity not found or not visible` — no site with this ID, the site is not visible to the user, or it belongs to another scope |
| 400 | `INVALID_PARAMS` | `Unknown system-page type` — `type` is not in the list of roles |
| 400 | `INVALID_PARAMS` | `id must be a positive safe integer` — `id` is not a positive integer |
| 400 | `INVALID_PARAMS` | `Unsupported query parameter` — a query parameter the method does not accept was passed |
| 400 | `INVALID_SCOPE` | `scope` is not `KNOWLEDGE`, `GROUP` or `MAINPAGE` |
| 409 | `LANDING_MODULE_NOT_ENABLED` | The Sites module is unavailable on this Bitrix24 account. Ask a Bitrix24 account administrator to enable it — until then a retry returns the same refusal |
| 422 | `BITRIX_ERROR` | `Bitrix24 returned an invalid URL` — Bitrix24 returned the URL in an unexpected form |
| 403 | `SCOPE_DENIED` | The API key does not have the `landing` scope |
| 401 | `TOKEN_MISSING` | The API key has no configured tokens |

Full list of common API errors — [Errors](/docs/errors).

## Known specifics

- **The URL is returned for an unpublished page too.** The method does not check publication: the URL matches what [`GET /v1/pages/:id/public-url`](/docs/entities/pages/public-url) returns for the same page, but visitors see the page at that URL only after it is published. Check publication by the `active` field in the [list of site system pages](/docs/entities/sites/system-pages-list).
- **For the site home page, the domain root is returned.** If the role is assigned a page that serves as the home page of the whole site, `url` is the site domain root, without the page path.
- **The URL is returned for a page in the trash too.** Moving a page to the trash does not remove it from the role, and the method keeps returning its URL.

## See also

- [System pages](/docs/entities/sites/system-pages)
- [List site system pages](/docs/entities/sites/system-pages-list)
- [Assign a system page](/docs/entities/sites/system-pages-set)
- [Page public URL](/docs/entities/pages/public-url)
- [Site public URL](/docs/entities/sites/public-url)
