> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paperjoy.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Pobierz kampanię

> Zwraca jedną z Twoich kampanii: treść, ustawienia i liczbę wierszy. Nie zawiera danych odbiorców z pliku CSV. Kampania z drugiego trybu zwraca `404`. Wymaga uprawnienia `campaigns:read`.



## OpenAPI

````yaml /openapi.yaml get /api/campaigns/{id}
openapi: 3.1.0
info:
  title: Paperjoy API
  version: '2026-10-19'
  description: >-
    Twórz, podglądaj i śledź prawdziwe, ręcznie pisane pocztówki. Klucz API
    decyduje, czy żądanie działa w trybie testowym, czy live.
  termsOfService: https://paperjoy.co/regulamin
  license:
    name: Proprietary
    url: https://paperjoy.co/regulamin
servers:
  - url: https://paperjoy.co
security:
  - bearerAuth: []
tags:
  - name: Konto
    description: Uwierzytelnione konto i saldo kredytów.
  - name: Pocztówki
    description: Tworzenie, podgląd, lista i pobieranie pocztówek.
  - name: Podpisy
    description: Własne podpisy odręczne Twojej organizacji.
  - name: Wzory
    description: Przody kartek z nadrukiem, gotowe i własne.
  - name: Kampanie
    description: Kampanie CSV utworzone w panelu, tylko do odczytu.
paths:
  /api/campaigns/{id}:
    get:
      tags:
        - Kampanie
      summary: Pobierz kampanię
      description: >-
        Zwraca jedną z Twoich kampanii: treść, ustawienia i liczbę wierszy. Nie
        zawiera danych odbiorców z pliku CSV. Kampania z drugiego trybu zwraca
        `404`. Wymaga uprawnienia `campaigns:read`.
      operationId: getCampaign
      parameters:
        - $ref: '#/components/parameters/CampaignId'
      responses:
        '200':
          description: Kampania.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignResponse'
              example:
                data:
                  id: cmp_4kQ9xW2mTb
                  test_mode: false
                  status: completed
                  file_name: klienci-wiosna.csv
                  message: |-
                    Dzień dobry {{imie}}!
                    Na wiosnę mamy dla Was 10% rabatu z kodem {{kod_rabatowy}}.
                  font_id: font-1
                  mistake: true
                  signature: Marta z Kwiaciarni Pod Lipą
                  signature_id: null
                  counts:
                    rows: 12
                    invalid: 0
                    skipped: 1
                    postcards: 11
                  completed_at: '2026-11-17T15:02:00+00:00'
                  created_at: '2026-11-17T14:40:00+00:00'
                  updated_at: '2026-11-17T15:02:00+00:00'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    CampaignId:
      name: id
      in: path
      required: true
      description: ID kampanii z listy kampanii albo z adresu kampanii w panelu.
      schema:
        type: string
        examples:
          - cmp_4kQ9xW2mTb
  schemas:
    CampaignResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/Campaign'
    Campaign:
      type: object
      description: >-
        Kampania CSV. Nie zawiera kolumn ani wierszy pliku, bo są w nich dane
        odbiorców.
      required:
        - id
        - test_mode
        - status
        - file_name
        - message
        - font_id
        - mistake
        - signature
        - signature_id
        - counts
        - completed_at
        - created_at
        - updated_at
      properties:
        id:
          type: string
          examples:
            - cmp_4kQ9xW2mTb
        test_mode:
          type: boolean
          description: >-
            `true` dla kampanii testowej. Jej pocztówki są darmowe i nigdy nie
            są pisane ani wysyłane.
        status:
          $ref: '#/components/schemas/CampaignStatus'
        file_name:
          type: string
          description: Nazwa wgranego pliku.
          examples:
            - klienci-wiosna.csv
        message:
          type:
            - string
            - 'null'
          description: >-
            Treść kartki ze zmiennymi, np. `{{imie}}`, wspólna dla całej
            kampanii. `null`, dopóki nie zapiszesz kroku treści.
        font_id:
          description: Pismo albo `null` przed zapisaniem kroku treści.
          oneOf:
            - $ref: '#/components/schemas/FontId'
            - type: 'null'
        mistake:
          type:
            - boolean
            - 'null'
          description: >-
            Czy kartki mają przekreślone słowo. `null` przed zapisaniem kroku
            treści.
        signature:
          type:
            - string
            - 'null'
          description: Wpisany podpis albo `null`.
        signature_id:
          type:
            - string
            - 'null'
          description: Własny podpis kampanii albo `null`.
          examples:
            - sig_ZeXOkSQjTp
        design_id:
          type:
            - string
            - 'null'
          description: Wzór przodu kampanii albo `null` dla czystego przodu.
          examples:
            - wz_7Hs1Qa
        counts:
          type: object
          description: Liczba wierszy pliku według stanu.
          required:
            - rows
            - invalid
            - skipped
            - postcards
          properties:
            rows:
              type: integer
              minimum: 0
              description: Wiersze z danymi w pliku.
            invalid:
              type: integer
              minimum: 0
              description: Wiersze, które czekają na poprawkę.
            skipped:
              type: integer
              minimum: 0
              description: Wiersze pominięte, z których nie powstanie kartka.
            postcards:
              type: integer
              minimum: 0
              description: >-
                Pocztówki utworzone przy potwierdzeniu. `0` przed
                potwierdzeniem.
        completed_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            Moment potwierdzenia kampanii. `null`, dopóki status nie zmieni się
            na `completed`.
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Error:
      type: object
      required:
        - message
      properties:
        message:
          type: string
    CampaignStatus:
      type: string
      description: >-
        Krok kampanii: `mapping` (mapowanie kolumn), `content` (treść kartki),
        `validation` (weryfikacja wierszy), `confirmation` (potwierdzenie) albo
        `completed` (pocztówki utworzone).
      enum:
        - mapping
        - content
        - validation
        - confirmation
        - completed
    FontId:
      type: string
      enum:
        - font-1
        - font-2
      description: >-
        `font-1` to czytelne, zaokrąglone pismo (Standardowe). `font-2` to
        szybsze pismo łączone (Szybkie).
  responses:
    Unauthorized:
      description: Brak klucza API albo klucz jest nieprawidłowy, unieważniony lub wygasł.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: Unauthenticated.
    Forbidden:
      description: >-
        Klucz API nie ma wymaganego uprawnienia albo zasób należy do kogoś
        innego.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: This action is unauthorized.
    NotFound:
      description: Zasób nie istnieje albo należy do drugiego trybu.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: Not found.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Klucz API Paperjoy. Klucze z prefiksem `pj_test_` działają w trybie
        testowym, a z `pj_live_` w trybie live.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.