{"openapi":"3.0.3","info":{"title":"Sorted Task — API v1","version":"1.0.0","description":"Publiczne API z kluczami. Uwierzytelnienie wyłącznie nagłówkiem Authorization: Bearer pm_<prefiks>_<sekret>; ciasteczko sesji jest ignorowane. W obrębie v1 wprowadzamy wyłącznie zmiany addytywne (nagłówek X-PM-API-Version: 1). Odpowiedzi błędów mają postać {\"error\": tekst, \"code\": kod maszynowy}. Listy: paginacja kursorem (?limit=1..200, ?cursor=, odpowiedź {data, next}), porządek rosnąco po id. Zapisy POST przyjmują Idempotency-Key. Klucz widzi to, co jego ranga (member albo kierownik) i lista projektów; zakres tylko zawęża."},"servers":[{"url":"/api/v1"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Klucz API utworzony przez administratora (Administracja → API i webhooki). Pokazywany raz, przy tworzeniu."}},"parameters":{"Limit":{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},"Kursor":{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"Dokładnie wartość next z poprzedniej odpowiedzi."},"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,128}$"},"description":"Jednorazowy klucz operacji. Powtórzenie z tym samym ładunkiem zwraca wynik pierwszego zapisu, z innym ładunkiem lub na innej trasie — 409 IDEMPOTENCY_KEY_REUSED."},"Id":{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}},"schemas":{"Blad":{"type":"object","required":["error"],"additionalProperties":false,"properties":{"error":{"type":"string"},"code":{"type":"string","description":"Kod maszynowy (API_KEY_INVALID, API_SCOPE_MISSING, VALIDATION_ERROR, INVALID_CURSOR, IDEMPOTENCY_KEY_REUSED, STALE_WRITE, RATE_LIMITED, …); brak przy zwykłym 404."},"userIds":{"type":"array","items":{"type":"integer"},"description":"Przy OSOBA_SPOZA_SKLADU: osoby spoza zbioru „kogo wolno przypisać”."},"current":{"$ref":"#/components/schemas/Zadanie"}}},"Me":{"type":"object","required":["name","prefix","scopes","role","projectIds","expiresAt"],"additionalProperties":false,"properties":{"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"role":{"type":"string","enum":["member","kierownik"]},"projectIds":{"type":"array","nullable":true,"items":{"type":"integer"},"description":"Lista projektów zawężająca klucz albo null (bez zawężenia)."},"expiresAt":{"type":"string","format":"date-time"}}},"Kamien":{"type":"object","required":["id","name","date","done","overdue"],"additionalProperties":false,"properties":{"id":{"type":"integer"},"name":{"type":"string"},"date":{"type":"string","nullable":true},"done":{"type":"boolean"},"overdue":{"type":"boolean"}}},"Projekt":{"type":"object","required":["id","name","leadId","leadName","status","startDate","deadline","parentProjectId","milestones","memberIds"],"additionalProperties":false,"properties":{"id":{"type":"integer"},"name":{"type":"string"},"leadId":{"type":"integer"},"leadName":{"type":"string"},"status":{"type":"string","nullable":true},"startDate":{"type":"string","nullable":true},"deadline":{"type":"string","nullable":true},"parentProjectId":{"type":"integer","nullable":true},"milestones":{"type":"array","items":{"$ref":"#/components/schemas/Kamien"}},"memberIds":{"type":"array","items":{"type":"integer"}}}},"Zadanie":{"type":"object","required":["id","projectId","title","description","column","priority","due","tag","assigneeIds","commentCount","blockedByTaskId","isBlocked","repeat","createdAt","updatedAt"],"additionalProperties":false,"properties":{"id":{"type":"integer"},"projectId":{"type":"integer"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"column":{"type":"string","enum":["todo","progress","review","done"]},"priority":{"type":"string","enum":["high","med","low"]},"due":{"type":"string","nullable":true},"tag":{"type":"string","nullable":true},"assigneeIds":{"type":"array","items":{"type":"integer"}},"commentCount":{"type":"integer"},"blockedByTaskId":{"type":"integer","nullable":true},"isBlocked":{"type":"boolean"},"repeat":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time","nullable":true},"updatedAt":{"type":"string","format":"date-time","nullable":true}}},"Komentarz":{"type":"object","required":["id","taskId","authorId","authorName","body","createdAt","automationId"],"additionalProperties":false,"properties":{"id":{"type":"integer"},"taskId":{"type":"integer"},"authorId":{"type":"integer"},"authorName":{"type":"string"},"body":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"automationId":{"type":"integer","nullable":true}}},"CzlonekZespolu":{"type":"object","required":["id","name","initials","position"],"additionalProperties":false,"properties":{"id":{"type":"integer"},"name":{"type":"string"},"initials":{"type":"string","nullable":true},"position":{"type":"string","nullable":true}}},"WpisCzasu":{"type":"object","required":["id","userId","projectId","taskId","date","start","end","hours","source","createdAt"],"additionalProperties":false,"properties":{"id":{"type":"integer"},"userId":{"type":"integer"},"projectId":{"type":"integer"},"taskId":{"type":"integer","nullable":true},"date":{"type":"string"},"start":{"type":"string"},"end":{"type":"string"},"hours":{"type":"number"},"source":{"type":"string"},"createdAt":{"type":"string","format":"date-time","nullable":true}}},"Kontakt":{"type":"object","required":["id","kind","name","organizationId","organizationName","position","categories","website","createdAt","updatedAt"],"additionalProperties":false,"properties":{"id":{"type":"integer"},"kind":{"type":"string","enum":["organizacja","osoba"]},"name":{"type":"string"},"organizationId":{"type":"integer","nullable":true},"organizationName":{"type":"string","nullable":true},"position":{"type":"string","nullable":true},"categories":{"type":"array","items":{"type":"string","enum":["darczynca","partner","dostawca","grantodawca","klient","wolontariusz","inna"]}},"website":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"ZadanieNowe":{"type":"object","required":["projectId"],"additionalProperties":false,"properties":{"projectId":{"type":"integer","minimum":1},"title":{"type":"string"},"description":{"type":"string"},"priority":{"type":"string","enum":["high","med","low"]},"tag":{"type":"string"},"due":{"type":"string","format":"date"},"assigneeIds":{"type":"array","items":{"type":"integer"},"description":"Tylko klucz z rangą kierownika; osoby ze składu projektu. Brak albo pusta lista = osoba prowadząca projekt (konto usługi nie bywa przypisane)."}}},"ZadanieZmiana":{"type":"object","required":[],"additionalProperties":false,"properties":{"title":{"type":"string"},"description":{"type":"string"},"column":{"type":"string","enum":["todo","progress","review","done"]},"priority":{"type":"string","enum":["high","med","low"]},"due":{"type":"string","format":"date"},"tag":{"type":"string"},"assigneeIds":{"type":"array","items":{"type":"integer"}},"baseUpdatedAt":{"type":"string","description":"Wartość updatedAt, na której klient oparł zmianę; rozjazd to 409 STALE_WRITE."}}},"KomentarzNowy":{"type":"object","required":["body"],"additionalProperties":false,"properties":{"body":{"type":"string","minLength":1,"maxLength":5000}}},"StronaProjektow":{"type":"object","required":["data","next"],"additionalProperties":false,"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Projekt"}},"next":{"type":"string","nullable":true,"description":"Kursor następnej strony (nieprzezroczysty) albo null na ostatniej."}}},"StronaZadan":{"type":"object","required":["data","next"],"additionalProperties":false,"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Zadanie"}},"next":{"type":"string","nullable":true,"description":"Kursor następnej strony (nieprzezroczysty) albo null na ostatniej."}}},"StronaKomentarzy":{"type":"object","required":["data","next"],"additionalProperties":false,"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Komentarz"}},"next":{"type":"string","nullable":true,"description":"Kursor następnej strony (nieprzezroczysty) albo null na ostatniej."}}},"StronaZespolu":{"type":"object","required":["data","next"],"additionalProperties":false,"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CzlonekZespolu"}},"next":{"type":"string","nullable":true,"description":"Kursor następnej strony (nieprzezroczysty) albo null na ostatniej."}}},"StronaWpisowCzasu":{"type":"object","required":["data","next"],"additionalProperties":false,"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WpisCzasu"}},"next":{"type":"string","nullable":true,"description":"Kursor następnej strony (nieprzezroczysty) albo null na ostatniej."}}},"StronaKontaktow":{"type":"object","required":["data","next"],"additionalProperties":false,"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Kontakt"}},"next":{"type":"string","nullable":true,"description":"Kursor następnej strony (nieprzezroczysty) albo null na ostatniej."}}},"Webhook":{"type":"object","required":["id","name","url","types","enabled","disabledReason","consecutiveFailures","lastDeliveryAt","lastStatus","createdAt"],"additionalProperties":false,"properties":{"id":{"type":"integer"},"name":{"type":"string"},"url":{"type":"string","description":"Adres odbiorcy (https, port 443), taki jak podany przy tworzeniu."},"types":{"type":"array","items":{"type":"string","enum":["task.created","task.updated","task.completed","task.assigned","comment.created","time_entry.created","leave.requested","leave.decided","project.created"]}},"enabled":{"type":"boolean"},"disabledReason":{"type":"string","nullable":true,"description":"PORAZKI (10 kolejnych nieudanych dostaw), HTTP_410, RECZNIE, KLUCZ_ODWOLANY albo TWORCA_UTRACIL_RANGE (twórca przestał być administratorem); null, gdy webhook jest włączony."},"consecutiveFailures":{"type":"integer"},"lastDeliveryAt":{"type":"string","format":"date-time","nullable":true},"lastStatus":{"type":"string","nullable":true,"description":"Status HTTP ostatniej udanej dostawy albo kod błędu ostatniej nieudanej (TIMEOUT, TLS, DNS_BLAD, HTTP_5XX, …)."},"createdAt":{"type":"string","format":"date-time"}}},"WebhookUtworzony":{"type":"object","required":["id","name","url","types","enabled","disabledReason","consecutiveFailures","lastDeliveryAt","lastStatus","createdAt","secret"],"additionalProperties":false,"properties":{"id":{"type":"integer"},"name":{"type":"string"},"url":{"type":"string","description":"Adres odbiorcy (https, port 443), taki jak podany przy tworzeniu."},"types":{"type":"array","items":{"type":"string","enum":["task.created","task.updated","task.completed","task.assigned","comment.created","time_entry.created","leave.requested","leave.decided","project.created"]}},"enabled":{"type":"boolean"},"disabledReason":{"type":"string","nullable":true,"description":"PORAZKI (10 kolejnych nieudanych dostaw), HTTP_410, RECZNIE, KLUCZ_ODWOLANY albo TWORCA_UTRACIL_RANGE (twórca przestał być administratorem); null, gdy webhook jest włączony."},"consecutiveFailures":{"type":"integer"},"lastDeliveryAt":{"type":"string","format":"date-time","nullable":true},"lastStatus":{"type":"string","nullable":true,"description":"Status HTTP ostatniej udanej dostawy albo kod błędu ostatniej nieudanej (TIMEOUT, TLS, DNS_BLAD, HTTP_5XX, …)."},"createdAt":{"type":"string","format":"date-time"},"secret":{"type":"string","description":"Sekret podpisu (whsec_…) — widoczny TYLKO w tej odpowiedzi."}}},"WebhookNowy":{"type":"object","required":["name","url","types"],"additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":80},"url":{"type":"string","maxLength":500,"description":"Adres https na porcie 443, nazwa domenowa (nie numer IP, nie localhost ani nazwa lokalna); sprawdzany przy zapisie i przy każdej dostawie."},"types":{"type":"array","minItems":1,"items":{"type":"string","enum":["task.created","task.updated","task.completed","task.assigned","comment.created","time_entry.created","leave.requested","leave.decided","project.created"]},"description":"Typy zdarzeń; zakresy klucza ograniczają ich zbiór (zadania:czytaj → task.* i comment.created, czas:czytaj → time_entry.created, projekty:czytaj → project.created)."}}},"StronaWebhookow":{"type":"object","required":["data","next"],"additionalProperties":false,"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}},"next":{"type":"string","nullable":true,"description":"Kursor następnej strony (nieprzezroczysty) albo null na ostatniej."}}}},"responses":{"Walidacja":{"description":"Zły parametr, ciało albo kursor (VALIDATION_ERROR, INVALID_CURSOR, INVALID_ASSIGNEES, OSOBA_SPOZA_SKLADU).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Blad"}}}},"Nieautoryzowane":{"description":"Klucz nieprawidłowy, odwołany (API_KEY_INVALID) albo wygasły (API_KEY_EXPIRED).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Blad"}}}},"BrakZakresu":{"description":"Klucz nie ma zakresu wymaganego przez trasę (API_SCOPE_MISSING) albo ranga nie pozwala na operację (INSUFFICIENT_ROLE).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Blad"}}}},"NieZnaleziono":{"description":"Zasób nie istnieje, nie jest widoczny dla klucza albo moduł organizacji jest wyłączony.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Blad"}}}},"Konflikt":{"description":"STALE_WRITE (zadanie zmieniło się od baseUpdatedAt; w current bieżący stan) albo IDEMPOTENCY_KEY_REUSED.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Blad"}}}},"ZaDuzoZadan":{"description":"Limit żądań (RATE_LIMITED): 120/min na klucz, 600/min na organizację. Nagłówek Retry-After podaje liczbę sekund.","headers":{"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Blad"}}}}}},"security":[{"bearerAuth":[]}],"paths":{"/openapi.json":{"get":{"operationId":"pobierzOpenApi","summary":"Ten dokument (publiczny, statyczny, bez danych organizacji).","security":[],"x-zakres":null,"x-modul":null,"responses":{"200":{"description":"Dokument OpenAPI 3.0.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/me":{"get":{"operationId":"pobierzMe","summary":"Opis klucza, którym wykonano żądanie (bez sekretów).","x-zakres":null,"x-modul":"integrations","responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"401":{"$ref":"#/components/responses/Nieautoryzowane"},"404":{"$ref":"#/components/responses/NieZnaleziono"},"429":{"$ref":"#/components/responses/ZaDuzoZadan"}}}},"/projects":{"get":{"operationId":"listaProjektow","summary":"Lista projektów widocznych dla klucza (bez budżetów i pól dodatkowych).","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Kursor"}],"x-zakres":"projekty:czytaj","x-modul":null,"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StronaProjektow"}}}},"400":{"$ref":"#/components/responses/Walidacja"},"401":{"$ref":"#/components/responses/Nieautoryzowane"},"403":{"$ref":"#/components/responses/BrakZakresu"},"429":{"$ref":"#/components/responses/ZaDuzoZadan"}}}},"/projects/{id}":{"get":{"operationId":"pobierzProjekt","summary":"Projekt (bez budżetów i pól dodatkowych).","parameters":[{"$ref":"#/components/parameters/Id"}],"x-zakres":"projekty:czytaj","x-modul":null,"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Projekt"}}}},"401":{"$ref":"#/components/responses/Nieautoryzowane"},"403":{"$ref":"#/components/responses/BrakZakresu"},"404":{"$ref":"#/components/responses/NieZnaleziono"},"429":{"$ref":"#/components/responses/ZaDuzoZadan"}}}},"/tasks":{"get":{"operationId":"listaZadan","summary":"Lista zadań widocznych dla klucza (bez załączników i pól dodatkowych).","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Kursor"},{"name":"projectId","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"column","in":"query","required":false,"schema":{"type":"string","enum":["todo","progress","review","done"]}},{"name":"assigneeId","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"updatedSince","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"dueBefore","in":"query","required":false,"schema":{"type":"string","format":"date"}}],"x-zakres":"zadania:czytaj","x-modul":null,"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StronaZadan"}}}},"400":{"$ref":"#/components/responses/Walidacja"},"401":{"$ref":"#/components/responses/Nieautoryzowane"},"403":{"$ref":"#/components/responses/BrakZakresu"},"429":{"$ref":"#/components/responses/ZaDuzoZadan"}}},"post":{"operationId":"utworzZadanie","summary":"Tworzy zadanie (Idempotency-Key chroni przed duplikatem przy ponowieniu).","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"x-zakres":"zadania:pisz","x-modul":null,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZadanieNowe"}}}},"responses":{"201":{"description":"Utworzono.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Zadanie"}}}},"400":{"$ref":"#/components/responses/Walidacja"},"401":{"$ref":"#/components/responses/Nieautoryzowane"},"403":{"$ref":"#/components/responses/BrakZakresu"},"404":{"$ref":"#/components/responses/NieZnaleziono"},"409":{"$ref":"#/components/responses/Konflikt"},"429":{"$ref":"#/components/responses/ZaDuzoZadan"}}}},"/tasks/{id}":{"get":{"operationId":"pobierzZadanie","summary":"Zadanie.","parameters":[{"$ref":"#/components/parameters/Id"}],"x-zakres":"zadania:czytaj","x-modul":null,"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Zadanie"}}}},"401":{"$ref":"#/components/responses/Nieautoryzowane"},"403":{"$ref":"#/components/responses/BrakZakresu"},"404":{"$ref":"#/components/responses/NieZnaleziono"},"429":{"$ref":"#/components/responses/ZaDuzoZadan"}}},"patch":{"operationId":"zmienZadanie","summary":"Zmienia zadanie (bez kosza i usuwania). baseUpdatedAt chroni przed nadpisaniem cudzej zmiany (409 STALE_WRITE).","parameters":[{"$ref":"#/components/parameters/Id"}],"x-zakres":"zadania:pisz","x-modul":null,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZadanieZmiana"}}}},"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Zadanie"}}}},"400":{"$ref":"#/components/responses/Walidacja"},"401":{"$ref":"#/components/responses/Nieautoryzowane"},"403":{"$ref":"#/components/responses/BrakZakresu"},"404":{"$ref":"#/components/responses/NieZnaleziono"},"409":{"$ref":"#/components/responses/Konflikt"},"429":{"$ref":"#/components/responses/ZaDuzoZadan"}}}},"/tasks/{id}/comments":{"get":{"operationId":"listaKomentarzy","summary":"Komentarze zadania (tekst, bez plików).","parameters":[{"$ref":"#/components/parameters/Id"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Kursor"}],"x-zakres":"zadania:czytaj","x-modul":null,"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StronaKomentarzy"}}}},"400":{"$ref":"#/components/responses/Walidacja"},"401":{"$ref":"#/components/responses/Nieautoryzowane"},"403":{"$ref":"#/components/responses/BrakZakresu"},"404":{"$ref":"#/components/responses/NieZnaleziono"},"429":{"$ref":"#/components/responses/ZaDuzoZadan"}}},"post":{"operationId":"dodajKomentarz","summary":"Dodaje komentarz tekstowy do zadania (Idempotency-Key chroni przed duplikatem).","parameters":[{"$ref":"#/components/parameters/Id"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-zakres":"komentarze:pisz","x-modul":null,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KomentarzNowy"}}}},"responses":{"201":{"description":"Utworzono.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Komentarz"}}}},"400":{"$ref":"#/components/responses/Walidacja"},"401":{"$ref":"#/components/responses/Nieautoryzowane"},"403":{"$ref":"#/components/responses/BrakZakresu"},"404":{"$ref":"#/components/responses/NieZnaleziono"},"409":{"$ref":"#/components/responses/Konflikt"},"429":{"$ref":"#/components/responses/ZaDuzoZadan"}}}},"/team":{"get":{"operationId":"listaZespolu","summary":"Osoby zespołu: id, imię, inicjały, stanowisko (bez e-maili, stawek i kont usługi).","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Kursor"}],"x-zakres":"zespol:czytaj","x-modul":null,"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StronaZespolu"}}}},"400":{"$ref":"#/components/responses/Walidacja"},"401":{"$ref":"#/components/responses/Nieautoryzowane"},"403":{"$ref":"#/components/responses/BrakZakresu"},"429":{"$ref":"#/components/responses/ZaDuzoZadan"}}}},"/time-entries":{"get":{"operationId":"listaWpisowCzasu","summary":"Wpisy czasu pracy (ranga member — tylko własne; bez stawek i kosztów).","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Kursor"},{"name":"projectId","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"userId","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"}}],"x-zakres":"czas:czytaj","x-modul":"time","responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StronaWpisowCzasu"}}}},"400":{"$ref":"#/components/responses/Walidacja"},"401":{"$ref":"#/components/responses/Nieautoryzowane"},"403":{"$ref":"#/components/responses/BrakZakresu"},"404":{"$ref":"#/components/responses/NieZnaleziono"},"429":{"$ref":"#/components/responses/ZaDuzoZadan"}}}},"/contacts":{"get":{"operationId":"listaKontaktow","summary":"Kontakty organizacji (bez NIP, adresu, e-maila, telefonu, notatek i historii).","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Kursor"},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["organizacja","osoba"]}},{"name":"category","in":"query","required":false,"schema":{"type":"string","enum":["darczynca","partner","dostawca","grantodawca","klient","wolontariusz","inna"]}},{"name":"organizationId","in":"query","required":false,"schema":{"type":"integer","minimum":1}}],"x-zakres":"kontakty:czytaj","x-modul":"contacts","responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StronaKontaktow"}}}},"400":{"$ref":"#/components/responses/Walidacja"},"401":{"$ref":"#/components/responses/Nieautoryzowane"},"403":{"$ref":"#/components/responses/BrakZakresu"},"404":{"$ref":"#/components/responses/NieZnaleziono"},"429":{"$ref":"#/components/responses/ZaDuzoZadan"}}}},"/contacts/{id}":{"get":{"operationId":"pobierzKontakt","summary":"Kontakt (bez NIP, adresu, e-maila, telefonu, notatek i historii).","parameters":[{"$ref":"#/components/parameters/Id"}],"x-zakres":"kontakty:czytaj","x-modul":"contacts","responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Kontakt"}}}},"401":{"$ref":"#/components/responses/Nieautoryzowane"},"403":{"$ref":"#/components/responses/BrakZakresu"},"404":{"$ref":"#/components/responses/NieZnaleziono"},"429":{"$ref":"#/components/responses/ZaDuzoZadan"}}}},"/webhooks":{"get":{"operationId":"listaWebhookow","summary":"Subskrypcje webhooków utworzone tym kluczem (bez sekretu).","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Kursor"}],"x-zakres":"webhooki","x-modul":"integrations","responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StronaWebhookow"}}}},"400":{"$ref":"#/components/responses/Walidacja"},"401":{"$ref":"#/components/responses/Nieautoryzowane"},"403":{"$ref":"#/components/responses/BrakZakresu"},"404":{"$ref":"#/components/responses/NieZnaleziono"},"429":{"$ref":"#/components/responses/ZaDuzoZadan"}}},"post":{"operationId":"utworzWebhook","summary":"Tworzy subskrypcję webhooka (najwyżej 5 na klucz). Odpowiedź niesie sekret podpisu — jedyny raz.","x-zakres":"webhooki","x-modul":"integrations","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookNowy"}}}},"responses":{"201":{"description":"Utworzono.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookUtworzony"}}}},"400":{"$ref":"#/components/responses/Walidacja"},"401":{"$ref":"#/components/responses/Nieautoryzowane"},"403":{"$ref":"#/components/responses/BrakZakresu"},"404":{"$ref":"#/components/responses/NieZnaleziono"},"429":{"$ref":"#/components/responses/ZaDuzoZadan"}}}},"/webhooks/{id}":{"delete":{"operationId":"usunWebhook","summary":"Usuwa subskrypcję utworzoną tym kluczem (cudzych nie widać: 404).","parameters":[{"$ref":"#/components/parameters/Id"}],"x-zakres":"webhooki","x-modul":"integrations","responses":{"204":{"description":"Usunięto."},"401":{"$ref":"#/components/responses/Nieautoryzowane"},"403":{"$ref":"#/components/responses/BrakZakresu"},"404":{"$ref":"#/components/responses/NieZnaleziono"},"429":{"$ref":"#/components/responses/ZaDuzoZadan"}}}}}}