List free slots
GET/api/v1/booking/slots
- Since
- 1.2.0
- Auth
- Bearer key
- operationId
- getSlots
Free slots of a service, counted live from schedules, time off and booked visits; optionally of one specialist. The range is at most 31 days. Without resource you get the slots of every specialist who performs the service. Responses are never cached (Cache-Control: no-store): availability changes live.
Request
Send the clinic's key in Authorization: Bearer (see API keys).
Query parameters
- servicestringrequired
The booking service id (catalog
services[].id). - resourcestring
The specialist id (catalog
resources[].id); omit for any specialist. - fromstring (date)required
First day, a local date YYYY-MM-DD (inclusive).
- tostring (date)required
Last day, a local date YYYY-MM-DD (inclusive).
curl "https://app.pozyskajpacjenta.pl/api/v1/booking/slots?service=bsvc_konsultacja&resource=bres_piotr&from=2026-10-05&to=2026-10-05" \
-H "Authorization: Bearer $PP_API_KEY"import { PozyskajPacjentaClient } from "@pozyskajpacjenta/sdk";
const client = new PozyskajPacjentaClient({
apiKey: process.env.PP_API_KEY ?? "",
baseUrl: "https://app.pozyskajpacjenta.pl",
});
const { slots } = await client.getSlots({
serviceId: "bsvc_konsultacja",
resourceId: "bres_piotr",
from: "2026-10-05",
to: "2026-10-05",
});<?php
$response = wp_remote_get(
'https://app.pozyskajpacjenta.pl/api/v1/booking/slots?service=bsvc_konsultacja&resource=bres_piotr&from=2026-10-05&to=2026-10-05',
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
200Free slots, earliest first.
- slotsSlot[]required
The slots.
Fields of each item (5)
- resourceIdstringrequired
The specialist, an id from the catalog's
resources. - startAtintegerrequired
Start, epoch seconds (UTC). Send it as
startAtto book. - endAtintegerrequired
End, epoch seconds (UTC).
- localDatestringrequired
Local date, YYYY-MM-DD.
- localStartMinintegerrequired
Local minute of the day (e.g. 570 = 9:30).
Free slots of one specialist on one day (trimmed to three)
{
"slots": [
{
"resourceId": "bres_piotr",
"startAt": 1791180000,
"endAt": 1791181800,
"localDate": "2026-10-05",
"localStartMin": 480
},
{
"resourceId": "bres_piotr",
"startAt": 1791180900,
"endAt": 1791182700,
"localDate": "2026-10-05",
"localStartMin": 495
},
{
"resourceId": "bres_piotr",
"startAt": 1791181800,
"endAt": 1791183600,
"localDate": "2026-10-05",
"localStartMin": 510
}
]
}Errors
| Status | code | When |
|---|---|---|
| 400 | A required parameter is missing | |
| 400 | More than 31 days | |
| 400 | Unknown service or specialist | |
| 400 | nfz_phone_only | An NFZ service (phone booking only) |
| 401 | No Authorization header | |
| 401 | Unknown or rotated key | |
| 429 | Over 120 requests in this minute |
Branch on the status and code, never on the Polish error text. All statuses in Errors.
{
"error": "wymagane parametry: service, from (YYYY-MM-DD), to (YYYY-MM-DD)"
}{
"error": "nieprawidłowy zakres dat (max 31 dni)"
}{
"error": "nie znaleziono usługi lub specjalisty"
}{
"error": "usługa NFZ — rejestracja telefoniczna",
"code": "nfz_phone_only"
}{
"error": "missing Authorization: Bearer <klucz z panelu Ustawienia>"
}{
"error": "invalid key"
}{
"error": "przekroczono limit 120 zapytań/min"
}Rate limit
- 120 requests per minute per key, shared by every endpoint.
- Every response to a valid key carries
RateLimit-RemainingandRateLimit-Reset; see Rate limits.
SDK method
client.getSlots(params: { serviceId, resourceId?, from, to }): Promise<{ slots: Slot[] }>
Throws ApiError 400; code: "nfz_phone_only" for an NFZ service.
The TypeScript tab above uses it. Install and errors: TypeScript SDK.