List appointments
GET/api/v1/booking/appointments
- Since
- 1.2.0
- Auth
- Bearer key
- operationId
- listAppointments
The clinic's appointments with the names of the service and the specialist, up to 500, earliest first. from and to are days (YYYY-MM-DD, inclusive), counted as UTC days. The list holds patient data (name, phone, e-mail): call it from your server only and never show it to the public. Responses are never cached.
Request
Send the clinic's key in Authorization: Bearer (see API keys).
Query parameters
- fromstring (date)
First day, YYYY-MM-DD (inclusive).
- tostring (date)
Last day, YYYY-MM-DD (inclusive).
curl "https://app.pozyskajpacjenta.pl/api/v1/booking/appointments?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 { appointments } = await client.listAppointments({
from: "2026-10-05",
to: "2026-10-05",
});<?php
$response = wp_remote_get(
'https://app.pozyskajpacjenta.pl/api/v1/booking/appointments?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
200The appointments.
- appointmentsAppointment[]required
The appointments.
Fields of each item (14)
- idstringrequired
Appointment id.
- startAtintegerrequired
Start, epoch seconds (UTC).
- endAtintegerrequired
End, epoch seconds (UTC).
- statusstringrequired
confirmed, cancelled, completed or no_show.
One of
confirmedcancelledcompletedno_show - patientNamestringrequired
Patient's full name.
- patientPhonestringrequired
Patient's phone, digits and +.
- patientEmailstring | null
Patient's e-mail; null when none.
- notestring | null
Note from the booking; null when none.
- leadIdstringrequired
The patient's lead in the clinic's CRM.
- serviceIdstringrequired
The booking service.
- serviceNamestringrequired
Name of the booking service.
- resourceIdstringrequired
The specialist.
- resourceNamestringrequired
Name of the specialist.
- sourcestringrequired
Where it was booked: site, widget, panel or api.
One of
sitewidgetpanelapi
Appointments on one day
{
"appointments": [
{
"id": "Onqp5yPLKb3IFff2WKfnV",
"startAt": 1791181800,
"endAt": 1791183600,
"status": "confirmed",
"patientName": "Jan Nowak",
"patientPhone": "+48600100200",
"patientEmail": "jan.nowak@example.com",
"note": "Pierwsza wizyta, ząb boli przy zimnym.",
"leadId": "lead_1",
"serviceId": "bsvc_konsultacja",
"serviceName": "Konsultacja stomatologiczna",
"resourceId": "bres_piotr",
"resourceName": "Piotr Nowicki",
"source": "api"
}
]
}Errors
| Status | When |
|---|---|
| 400 | from or to is not YYYY-MM-DD |
| 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": "from/to muszą być datami YYYY-MM-DD"
}{
"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.listAppointments(params?: { from?, to? }): Promise<{ appointments: Appointment[] }>
The TypeScript tab above uses it. Install and errors: TypeScript SDK.