Skip to content
Documentation
pozyskajpacjentaDocs

API referenceEntities

List posts

GET/api/v1/posts

Since
1.1.0
Auth
Bearer key
operationId
listPosts

The clinic's published posts, newest first. Responses are private to the key: Cache-Control: private, max-age=60, so cache them on your side for up to a minute.

Request

Send the clinic's key in Authorization: Bearer (see API keys).

No parameters and no body.

curl "https://app.pozyskajpacjenta.pl/api/v1/posts" \
  -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 { posts } = await client.listPosts();
<?php
$response = wp_remote_get(
    'https://app.pozyskajpacjenta.pl/api/v1/posts',
    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

200Published posts.

  • postsPostSummary[]required

    The posts.

    Fields of each item (7)
    • idstringrequired

      Post id.

    • slugstringrequired

      Slug from the post's address.

    • pathstringrequired

      Path of the post page.

    • titlestringrequired

      Title.

    • excerptstring | null

      Excerpt for lists; null when empty.

    • coverMediaRef | null

      Cover image; null when none.

      Fields (8)
      • urlstringrequired

        Absolute address of the file.

      • focalXinteger | null

        Horizontal focal point in percent (0 to 100) to keep when cropping, e.g. as object-position.

      • focalYinteger | null

        Vertical focal point in percent (0 to 100).

      • altstring | null

        Alternative text; null when the clinic left it empty.

      • widthintegersince 1.4.0

        Width of the original in px (library files, when known), for width/height attributes without layout shift.

      • heightintegersince 1.4.0

        Height of the original in px.

      • aiGeneratedbooleansince 1.4.0

        The image was generated by AI: label it next to the image (e.g. in a caption).

      • captionstringsince 1.4.0

        Caption to show under the image.

    • publishedAtstring (date-time) | null

      Publication date, ISO 8601; null when unknown.

Published posts (trimmed to two)

{
  "posts": [
    {
      "id": "post_tomograf",
      "slug": "nowy-tomograf-3d",
      "title": "Nowy tomograf 3D już w klinice",
      "excerpt": "Od czerwca pełną diagnostykę implantologiczną wykonasz bez wychodzenia z gabinetu, nowy tomograf CBCT skraca planowanie leczenia do jednej wizyty.",
      "publishedAt": "2026-06-28T00:00:00.000Z",
      "path": "/aktualnosci/nowy-tomograf-3d",
      "cover": null
    },
    {
      "id": "post_promocja",
      "slug": "letnia-promocja-higienizacja",
      "title": "Letnia promocja na higienizację",
      "excerpt": "Do końca sierpnia pakiet higienizacyjny, skaling, piaskowanie i fluoryzacja, w cenie 240 zł zamiast 290 zł.",
      "publishedAt": "2026-06-15T00:00:00.000Z",
      "path": "/aktualnosci/letnia-promocja-higienizacja",
      "cover": null
    }
  ]
}

Errors

StatusWhen
401No Authorization header
401Unknown or rotated key
429Over 120 requests in this minute

Branch on the status and code, never on the Polish error text. All statuses in Errors.

401 · No Authorization header
{
  "error": "missing Authorization: Bearer <klucz z panelu Ustawienia>"
}
401 · Unknown or rotated key
{
  "error": "invalid key"
}
429 · Over 120 requests in this minute
{
  "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-Remaining and RateLimit-Reset; see Rate limits.

SDK method

client.listPosts(): Promise<{ posts: PostSummary[] }>

The TypeScript tab above uses it. Install and errors: TypeScript SDK.