# List published pages

`GET https://app.pozyskajpacjenta.pl/api/v1/pages` · operationId `listPages` · since 1.0.0 · tag Content

Every published path of the site: pages built from blocks and the entity pages (treatments, team, case studies, posts). `type` is the `kind` GET /content returns, so you know what to expect before fetching a page. When a block page and an entity page share a path, the block page wins, as on the clinic's site. Responses are private to the key: `Cache-Control: private, max-age=60`, so cache them on your side for up to a minute.

## Request

Authorization: `Bearer <the clinic's key>`.

### cURL

```bash
curl "https://app.pozyskajpacjenta.pl/api/v1/pages" \
  -H "Authorization: Bearer $PP_API_KEY"
```

### TypeScript

```ts
import { PozyskajPacjentaClient } from "@pozyskajpacjenta/sdk";

const client = new PozyskajPacjentaClient({
  apiKey: process.env.PP_API_KEY ?? "",
  baseUrl: "https://app.pozyskajpacjenta.pl",
});

const { pages } = await client.listPages();
```

### PHP

```php
<?php
$response = wp_remote_get(
    'https://app.pozyskajpacjenta.pl/api/v1/pages',
    array(
        'headers' => array( 'Authorization' => 'Bearer ' . getenv( 'PP_API_KEY' ) ),
        'timeout' => 10,
    )
);
if ( is_wp_error( $response ) ) {
    error_log( $response->get_error_message() );
    return;
}
$status = wp_remote_retrieve_response_code( $response );
$data   = json_decode( wp_remote_retrieve_body( $response ), true );
```

## Response

### 200: Every published path.

- `pages` (`PageListItem[]`, required): The paths.
  - `path` (`string`, required): Path on the clinic's site; pass it to GET /content.
  - `title` (`string`, required): Page title.
  - `type` (`string`, required): The `kind` GET /content returns for this path. One of `page`, `services`, `service`, `team`, `doctor`, `case-studies`, `case-study`, `posts`, `post`.
  - `updatedAt` (`string (date-time)`, required): Last change, ISO 8601.

Example (Every published path (trimmed)):

```json
{
  "pages": [
    {
      "path": "/",
      "title": "Klinika Wzorcowa, stomatologia w Warszawie",
      "updatedAt": "2026-09-30T14:21:55.000Z",
      "type": "page"
    },
    {
      "path": "/rezerwacja",
      "title": "Rezerwacja wizyty",
      "updatedAt": "2026-09-30T14:21:55.000Z",
      "type": "page"
    },
    {
      "path": "/zabiegi",
      "title": "Zabiegi i usługi",
      "type": "services",
      "updatedAt": "2026-09-30T14:21:55.000Z"
    },
    {
      "path": "/zabiegi/konsultacja-stomatologiczna",
      "title": "Konsultacja stomatologiczna",
      "type": "service",
      "updatedAt": "2026-09-30T14:21:55.000Z"
    },
    {
      "path": "/zespol",
      "title": "Nasi lekarze",
      "type": "team",
      "updatedAt": "2026-09-30T14:21:55.000Z"
    }
  ]
}
```

## Errors

| Status | code | When |
| --- | --- | --- |
| 401 |  | No Authorization header |
| 401 |  | Unknown or rotated key |
| 429 |  | Over 120 requests in this minute |

401 (No Authorization header):

```json
{
  "error": "missing Authorization: Bearer <klucz z panelu Ustawienia>"
}
```

401 (Unknown or rotated key):

```json
{
  "error": "invalid key"
}
```

429 (Over 120 requests in this minute):

```json
{
  "error": "przekroczono limit 120 zapytań/min"
}
```

## Rate limit

- 120 requests per minute per key, shared by every endpoint.

## SDK method

`client.listPages(): Promise<{ pages: PageListItem[] }>`
