# List team members

`GET https://app.pozyskajpacjenta.pl/api/v1/doctors` · operationId `listDoctors` · since 1.1.0 · tag Entities

The clinic's published team members, in the clinic's order. 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/doctors" \
  -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 { doctors } = await client.listDoctors();
```

### PHP

```php
<?php
$response = wp_remote_get(
    'https://app.pozyskajpacjenta.pl/api/v1/doctors',
    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: Published team members.

- `doctors` (`DoctorSummary[]`, required): The team.
  - `id` (`string`, required): Team member id.
  - `slug` (`string`, required): Slug from the profile's address.
  - `path` (`string`, required): Path of the profile page.
  - `name` (`string`, required): Full name.
  - `title` (`string | null`): Professional title, e.g. lek. dent.; null when none.
  - `specializations` (`string[]`, required): Specialisations, in the clinic's order.
  - `photo` (`MediaRef | null`): Portrait; null when none.
    - `url` (`string`, required): Absolute address of the file.
    - `focalX` (`integer | null`): Horizontal focal point in percent (0 to 100) to keep when cropping, e.g. as object-position.
    - `focalY` (`integer | null`): Vertical focal point in percent (0 to 100).
    - `alt` (`string | null`): Alternative text; null when the clinic left it empty.
    - `width` (`integer`, since 1.4.0): Width of the original in px (library files, when known), for width/height attributes without layout shift.
    - `height` (`integer`, since 1.4.0): Height of the original in px.
    - `aiGenerated` (`boolean`, since 1.4.0): The image was generated by AI: label it next to the image (e.g. in a caption).
    - `caption` (`string`, since 1.4.0): Caption to show under the image.
  - `bookingResourceId` (`string | null`, required, since 1.3.0): Id of the active booking specialist for this profile: an entry of GET /booking/catalog and the `resource` parameter of /booking/slots. null when the profile is not linked to booking or the specialist is inactive.

Example (Published team members (trimmed to two)):

```json
{
  "doctors": [
    {
      "id": "doc_anna",
      "slug": "anna-wzorcowa",
      "name": "Anna Wzorcowa",
      "title": "dr n. med.",
      "bookingResourceId": "bres_anna",
      "path": "/zespol/anna-wzorcowa",
      "specializations": [
        "Implantologia",
        "Chirurgia stomatologiczna",
        "Protetyka"
      ],
      "photo": null
    },
    {
      "id": "doc_piotr",
      "slug": "piotr-nowicki",
      "name": "Piotr Nowicki",
      "title": "lek. dent.",
      "bookingResourceId": "bres_piotr",
      "path": "/zespol/piotr-nowicki",
      "specializations": [
        "Endodoncja mikroskopowa",
        "Stomatologia zachowawcza"
      ],
      "photo": null
    }
  ]
}
```

## 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.listDoctors(): Promise<{ doctors: DoctorSummary[] }>`
