# Get the patient process

`GET https://app.pozyskajpacjenta.pl/api/v1/process` · operationId `getProcess` · since 1.24.0 · tag Content

The clinic's patient process from the enquiry to the next visit: six steps, each with its actions (who acts, the channels, when, the full SMS text or what an e-mail holds) and their state, built from the clinic's settings exactly as its panel shows them (Ustawienia › Proces pacjenta). Read only, never patient data. Use it to tell patients on your own frontend what happens after they write (for example "we call back within 15 minutes"). Answers 403 with the code `feature_disabled` until the clinic has the patient process switched on. 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/process" \
  -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 { process } = await client.getProcess();
```

### PHP

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

- `process` (`PatientProcess`, required): The clinic's patient process.
  - `version` (`integer`, required): Version of the process shape (1). One of `1`.
  - `isDefault` (`boolean`, required): true while the clinic has not changed the default process.
  - `updatedAt` (`string (date-time) | null`, required): When the clinic last changed the process; null for the default one.
  - `speedTargetMinutes` (`integer`, required): Reception's target for calling a new patient back, in minutes.
  - `steps` (`ProcessStep[]`, required): The steps, in order.
    - `key` (`string`, required): The step's key. One of `zapytanie`, `szybka_odpowiedz`, `umowienie`, `przypomnienie`, `po_wizycie`, `recall`.
    - `position` (`integer`, required): The step's number, from 1.
    - `title` (`string`, required): Name of the step (Polish).
    - `summary` (`string`, required): What happens to the patient at this step (Polish).
    - `note` (`string | null`, required): The clinic's note for reception at this step (Polish), or null.
    - `actions` (`ProcessAction[]`, required): The step's actions.
      - `key` (`string`, required): The action's key. One of `powiadomienie_recepcji`, `sms_recepcji`, `sms_potwierdzenie`, `pierwszy_kontakt`, `sms_ponowienie`, `potwierdzenie_wizyty`, `przypomnienie_24h`, `przypomnienie_2h`, `opinia_google`, `zaproszenie_recall`.
      - `label` (`string`, required): What happens (Polish).
      - `who` (`string`, required): `pacjent`: the patient gets a message; `recepcja`: reception acts. One of `pacjent`, `recepcja`.
      - `channels` (`string[]`, required): The action's channels. One of `email`, `sms`, `telefon`, `panel`.
      - `timing` (`object`, required): When it happens.
        - `kind` (`string`, required): The kind of timing. One of `immediately`, `within_minutes`, `after_lead_hours`, `before_visit_hours`, `after_visit_days`, `after_visit_months`.
        - `value` (`object`): Minutes, hours or days; for `after_visit_months` the list of months set on the clinic's treatments. Absent for `immediately`.
      - `timingLabel` (`string`, required): The timing in words (Polish).
      - `template` (`object`, required): The words.
        - `source` (`string`, required): `platform`: the platform's text; `clinic`: the clinic's own. One of `platform`, `clinic`.
        - `text` (`string | null`, required): The full SMS text the patient gets; null for e-mails.
        - `description` (`string`, required): What the message holds (Polish).
      - `state` (`string`, required): `on`, `off`, or `needs_setup` (switched on but something it needs is missing). One of `on`, `off`, `needs_setup`.
      - `stateReason` (`string | null`, required): Why it is off or what it lacks (Polish), or null.
      - `setupHref` (`string | null`, required): The clinic panel screen that sets it, or null.

Example (A clinic's own process: SMS on, its own confirmation text, a 15-minute target):

```json
{
  "process": {
    "version": 1,
    "isDefault": false,
    "updatedAt": "2026-10-22T09:30:00.000Z",
    "speedTargetMinutes": 15,
    "steps": [
      {
        "key": "zapytanie",
        "position": 1,
        "title": "Nowe zapytanie",
        "summary": "Pacjent wysyła formularz, dzwoni albo pisze. Recepcja dowiaduje się o tym od razu.",
        "note": null,
        "actions": [
          {
            "key": "powiadomienie_recepcji",
            "label": "E-mail do recepcji o nowym zapytaniu",
            "who": "recepcja",
            "channels": [
              "email",
              "panel"
            ],
            "timing": {
              "kind": "immediately"
            },
            "template": {
              "source": "platform",
              "text": null,
              "description": "Kto pisze, czego dotyczy zapytanie i link do pacjenta w panelu."
            },
            "state": "on",
            "stateReason": null,
            "setupHref": "/panel/settings/powiadomienia",
            "timingLabel": "od razu"
          },
          {
            "key": "sms_recepcji",
            "label": "SMS do recepcji o nowym zapytaniu",
            "who": "recepcja",
            "channels": [
              "sms"
            ],
            "timing": {
              "kind": "immediately"
            },
            "template": {
              "source": "platform",
              "text": null,
              "description": "Krótka informacja o nowym zapytaniu na telefon recepcji."
            },
            "state": "off",
            "stateReason": null,
            "setupHref": "/panel/settings/powiadomienia#sms",
            "timingLabel": "od razu"
          }
        ]
      },
      {
        "key": "szybka_odpowiedz",
        "position": 2,
        "title": "Szybka odpowiedź",
        "summary": "Pacjent dostaje potwierdzenie, a recepcja oddzwania, zanim pacjent zadzwoni gdzie indziej.",
        "note": "Zadzwoń, przedstaw się, zapytaj, czego potrzebuje pacjent, i zaproponuj dwa terminy.",
        "actions": [
          {
            "key": "sms_potwierdzenie",
            "label": "SMS do pacjenta: otrzymaliśmy zapytanie",
            "who": "pacjent",
            "channels": [
              "sms"
            ],
            "timing": {
              "kind": "immediately"
            },
            "template": {
              "source": "clinic",
              "text": "Klinika Wzorcowa: dziękujemy za wiadomość. Oddzwonimy w ciągu kwadransa, w godzinach otwarcia.",
              "description": "Treść kliniki"
            },
            "state": "on",
            "stateReason": null,
            "setupHref": "/panel/settings/powiadomienia#sms",
            "timingLabel": "od razu"
          },
          {
            "key": "pierwszy_kontakt",
            "label": "Recepcja dzwoni do pacjenta",
            "who": "recepcja",
            "channels": [
              "telefon",
              "panel"
            ],
            "timing": {
              "kind": "within_minutes",
              "value": 15
            },
            "template": {
              "source": "platform",
              "text": null,
              "description": "Zapytanie czeka w Recepcji; po tym czasie dostaje oznaczenie, że czeka za długo."
            },
            "state": "on",
            "stateReason": null,
            "setupHref": "/panel/recepcja",
            "timingLabel": "w ciągu 15 minut"
          },
          {
            "key": "sms_ponowienie",
            "label": "SMS do pacjenta, gdy zapytanie wciąż czeka",
            "who": "pacjent",
            "channels": [
              "sms"
            ],
            "timing": {
              "kind": "after_lead_hours",
              "value": 4
            },
            "template": {
              "source": "platform",
              "text": "Klinika Wzorcowa: wciąż chcemy porozmawiać o Twoim zapytaniu. Zadzwoń do nas: +48 22 100 20 30 albo odbierz, gdy oddzwonimy.",
              "description": "Tekst platformy"
            },
            "state": "on",
            "stateReason": null,
            "setupHref": "/panel/settings/powiadomienia#sms",
            "timingLabel": "po 4 godzinach, między 8:00 a 20:00"
          }
        ]
      },
      {
        "key": "umowienie",
        "position": 3,
        "title": "Umówienie wizyty",
        "summary": "Pacjent wybiera termin na stronie albo umawia się z recepcją i dostaje potwierdzenie.",
        "note": null,
        "actions": [
          {
            "key": "potwierdzenie_wizyty",
            "label": "E-mail do pacjenta z potwierdzeniem wizyty",
            "who": "pacjent",
            "channels": [
              "email"
            ],
            "timing": {
              "kind": "immediately"
            },
            "template": {
              "source": "platform",
              "text": null,
              "description": "Data, godzina, miejsce, plik do kalendarza i link do zmiany terminu."
            },
            "state": "on",
            "stateReason": null,
            "setupHref": "/panel/booking?konfiguracja=1",
            "timingLabel": "od razu"
          }
        ]
      },
      {
        "key": "przypomnienie",
        "position": 4,
        "title": "Przypomnienie i przyjście",
        "summary": "Przed wizytą pacjent dostaje przypomnienie, żeby przyszedł albo zwolnił termin.",
        "note": null,
        "actions": [
          {
            "key": "przypomnienie_24h",
            "label": "Przypomnienie dzień przed wizytą",
            "who": "pacjent",
            "channels": [
              "email",
              "sms"
            ],
            "timing": {
              "kind": "before_visit_hours",
              "value": 24
            },
            "template": {
              "source": "platform",
              "text": null,
              "description": "Data, godzina i miejsce wizyty z linkiem do zmiany terminu."
            },
            "state": "on",
            "stateReason": null,
            "setupHref": "/panel/booking?konfiguracja=1#zasady",
            "timingLabel": "dzień przed wizytą (24 h)"
          },
          {
            "key": "przypomnienie_2h",
            "label": "Przypomnienie w dniu wizyty",
            "who": "pacjent",
            "channels": [
              "email",
              "sms"
            ],
            "timing": {
              "kind": "before_visit_hours",
              "value": 2
            },
            "template": {
              "source": "platform",
              "text": null,
              "description": "Data, godzina i miejsce wizyty z linkiem do zmiany terminu."
            },
            "state": "on",
            "stateReason": null,
            "setupHref": "/panel/booking?konfiguracja=1#zasady",
            "timingLabel": "2 h przed wizytą"
          }
        ]
      },
      {
        "key": "po_wizycie",
        "position": 5,
        "title": "Po wizycie",
        "summary": "Dzień po wizycie pacjent może zostawić opinię w Google.",
        "note": null,
        "actions": [
          {
            "key": "opinia_google",
            "label": "E-mail z prośbą o opinię w Google",
            "who": "pacjent",
            "channels": [
              "email"
            ],
            "timing": {
              "kind": "after_visit_days",
              "value": 1
            },
            "template": {
              "source": "platform",
              "text": null,
              "description": "Do każdego pacjenta ze zgodą na e-mail, najwyżej raz na pół roku, bez wybierania po ocenie."
            },
            "state": "on",
            "stateReason": null,
            "setupHref": "/panel/settings/powiadomienia#opinie",
            "timingLabel": "dzień po wizycie"
          }
        ]
      },
      {
        "key": "recall",
        "position": 6,
        "title": "Kolejna wizyta",
        "summary": "Gdy zbliża się czas kolejnej wizyty (np. higienizacji), pacjent dostaje zaproszenie.",
        "note": null,
        "actions": [
          {
            "key": "zaproszenie_recall",
            "label": "Zaproszenie na kolejną wizytę",
            "who": "pacjent",
            "channels": [
              "email",
              "sms"
            ],
            "timing": {
              "kind": "after_visit_months",
              "value": [
                6,
                12
              ]
            },
            "template": {
              "source": "platform",
              "text": null,
              "description": "Zaproszenie z linkiem do strony zabiegu, tylko do pacjentów ze zgodą na wiadomości."
            },
            "state": "on",
            "stateReason": null,
            "setupHref": "/panel/booking?konfiguracja=1#zabiegi",
            "timingLabel": "po 6, 12 miesiącach (zależnie od zabiegu)"
          }
        ]
      }
    ]
  }
}
```

## Errors

| Status | code | When |
| --- | --- | --- |
| 401 |  | No Authorization header |
| 401 |  | Unknown or rotated key |
| 403 | `feature_disabled` | The clinic has not switched the patient process on |
| 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"
}
```

403 (The clinic has not switched the patient process on):

```json
{
  "error": "Proces pacjenta nie jest włączony dla tej placówki.",
  "code": "feature_disabled"
}
```

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.getProcess(): Promise<ProcessInfo>`
