## Find a page by path

`GET /v1/pages/resolve`

Finds a page by its path within the given site and returns its ID. The found page is additionally read with the permissions of the user the key was issued for.

Requires the `landing` scope. A read-only key works.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|----------|
| `siteId` (query) | number | yes | Site ID. List: [`GET /v1/sites`](/docs/entities/sites/list) |
| `path` (query) | string | yes | Page path within the site, for example `/about/` |
| `scope` (query) | string | no | Site type: `KNOWLEDGE` — knowledge base, `GROUP` — workgroup site, `MAINPAGE` — main page. Omit the parameter for pages of other sites |

## Examples

### curl — personal key

```bash
curl "https://vibecode.bitrix24.com/v1/pages/resolve?siteId=3&path=%2Fabout%2F" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl "https://vibecode.bitrix24.com/v1/pages/resolve?siteId=3&path=%2Fabout%2F" \
  -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/resolve?siteId=3&path=%2Fabout%2F", {
  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/resolve?siteId=3&path=%2Fabout%2F", {
  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 | Always `true` on success |
| `data` | object | Search result |
| `data.pageId` | number | ID of the found page |

## Response example

```json
{
  "success": true,
  "data": {
    "pageId": 59
  }
}
```

## Error response example

404 — the site has no page at this path:

```json
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Page not found at this path."
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|----------|
| 404 | `ENTITY_NOT_FOUND` | `Site not found.` — site `siteId` does not exist |
| 404 | `ENTITY_NOT_FOUND` | `Page not found at this path.` — the site has no page at this path |
| 404 | `ENTITY_NOT_FOUND` | `Page not found.` — a page was found at the path, but the key's user cannot read it, or it belongs to another site |
| 404 | `ENTITY_NOT_FOUND` | `Page or folder not found.` — Bitrix24 did not find the page during the search |
| 400 | `MISSING_REQUIRED_FIELDS` | `siteId and path are required; siteId must be a positive safe integer.` — `siteId` or `path` is missing, or `siteId` is not a positive integer |
| 400 | `INVALID_SCOPE` | `scope must be KNOWLEDGE, GROUP or MAINPAGE, or omitted.` — `scope` is not `KNOWLEDGE`, `GROUP` or `MAINPAGE` |
| 422 | `BITRIX_NO_EFFECT` | `Bitrix24 returned an invalid resolved page id.` — Bitrix24 returned an invalid page ID |
| 422 | `BITRIX_ERROR` | Bitrix24 rejected the request. The error text comes from Bitrix24 |
| 403 | `SCOPE_DENIED` | The API key does not have the `landing` scope |
| 403 | `BITRIX_ACCESS_DENIED` | The Bitrix24 user the key was issued for has no permission to read the site |
| 401 | `TOKEN_MISSING` | The API key has no configured tokens |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |
| 401 | `INVALID_API_KEY` | The key in `X-Api-Key` is not found or has been revoked |
| 409 | `LANDING_MODULE_NOT_ENABLED` | The Sites module is not available on the Bitrix24 account |
| 409 | `PORTAL_ADDRESS_CHANGED` | The on-premise Bitrix24 moved to a new address, but the key's webhook was issued for the old one. Reissue the key's webhook |
| 429 | `RATE_LIMITED` | The Bitrix24 request limit is exceeded. Retry the request in 1-2 seconds |
| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 did not respond or returned a server error |
| 503 | `BITRIX_TIMEOUT` | Bitrix24 did not respond in time |

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

## See also

- [Get a page](/docs/entities/pages/get)
- [Page public URL](/docs/entities/pages/public-url)
- [Pages](/docs/entities/pages)
