
## Page public URL

`GET /v1/pages/:id/public-url`

The address is returned even for an unpublished page. published is read from ACTIVE; the address alone does not prove the page is reachable.

Requires the `landing` scope. Available to a READONLY key.

## Request parameters

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | integer | yes | Page ID from [List pages](/docs/entities/pages/list). |
| `scope` | string | no | Query: KNOWLEDGE, GROUP or MAINPAGE; omit for an ordinary site. |

## Examples

### curl — personal key

```bash
curl -X GET "https://vibecode.bitrix24.com/v1/pages/42/public-url" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl -X GET "https://vibecode.bitrix24.com/v1/pages/42/public-url" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"
```

### JavaScript — personal key

```javascript
const response = await fetch("https://vibecode.bitrix24.com/v1/pages/42/public-url", {
  method: "GET",
  headers: {"X-Api-Key": "YOUR_API_KEY"},
})
const result = await response.json()
if (!response.ok) throw new Error(result.error.message)
console.log(result.data)
```

### JavaScript — OAuth application

```javascript
const response = await fetch("https://vibecode.bitrix24.com/v1/pages/42/public-url", {
  method: "GET",
  headers: {"X-Api-Key": "YOUR_APP_KEY", "Authorization": "Bearer USER_SESSION_TOKEN"},
})
const result = await response.json()
if (!response.ok) throw new Error(result.error.message)
console.log(result.data)
```

## Response fields

| Field | Type | Description |
|---|---|---|
| `success` | boolean | true |
| `data` | object | Operation result. |
| `data.url` | string | url |
| `data.published` | boolean | Page ACTIVE flag. |

```json
{
  "success": true,
  "data": {
    "url": "https://example.bitrix24.site/example/",
    "published": false
  }
}
```

## Errors

| HTTP | Code | Condition |
|---|---|---|
| 400 | `INVALID_PAGE_ID` | id is not a positive safe integer. |
| 400 | `INVALID_PARAMS` | Invalid body shape or parameter value. |
| 400 | `INVALID_SCOPE` | Invalid scope. |
| 401 | `TOKEN_MISSING` | No Bitrix24 credentials. |
| 403 | `SCOPE_DENIED` | The key lacks landing. |
| 403 | `BITRIX_ACCESS_DENIED` | The Bitrix24 user lacks permission. |
| 404 | `ENTITY_NOT_FOUND` | Page not found. |
| 422 | `BITRIX_ERROR` | Bitrix24 business refusal; its message is preserved. |
| 422 | `BITRIX_NO_EFFECT` | Bitrix24 did not confirm the action or return the expected result. |

[All system errors](/docs/errors).

400 — invalid scope:

```json
{
  "success": false,
  "error": {
    "code": "INVALID_SCOPE",
    "message": "scope must be KNOWLEDGE, GROUP or MAINPAGE, or omitted."
  }
}
```

## See also

- [Pages](/docs/entities/pages)
- [Page templates](/docs/entities/page-templates)
