Skip to main content
Dokumenty to główny zasób w clarife. Każdy dokument zawiera bloki (tekst, nagłówki, zrzuty ekranu, kod, tabele). Wymagane scopy: documents:read, documents:write

Lista dokumentów

curl -s "https://my.clarife.app/api/v1/documents?limit=10&offset=0&sort=updated_at&order=desc" \
  -H "Authorization: Bearer clrf_xxxxx" | jq
Parametry query:
ParametrTypDomyślnieOpis
limitinteger50Wyniki na stronę (1-100)
offsetinteger0Przesunięcie paginacji
sortstringupdated_atPole sortowania: updated_at, created_at, title
orderstringdescKolejność: asc lub desc
project_iduuidFiltruj po projekcie
Odpowiedź 200 OK:
{
  "data": [
    {
      "id": "d1234567-...",
      "title": "Mój tutorial",
      "description": "Jak skonfigurować...",
      "updated_at": "2026-03-28T12:00:00Z",
      "created_at": "2026-03-20T10:00:00Z",
      "block_count": 12,
      "screenshot_count": 5,
      "word_count": 450,
      "visibility": "private"
    }
  ],
  "total": 42,
  "limit": 10,
  "offset": 0
}

Pobierz dokument

curl -s https://my.clarife.app/api/v1/documents/DOCUMENT_ID \
  -H "Authorization: Bearer clrf_xxxxx" | jq
Zwraca pełną treść dokumentu z blokami (content). Odpowiedź 200 OK:
{
  "id": "d1234567-...",
  "title": "Mój tutorial",
  "description": "Jak skonfigurować...",
  "content": {
    "meta": { "version": 1, "locale": "pl" },
    "blocks": [
      { "type": "heading", "content": "Krok 1" },
      { "type": "text", "content": "<p>Otwórz ustawienia...</p>" },
      { "type": "screenshot", "media_id": "m1234..." }
    ]
  },
  "block_count": 3,
  "screenshot_count": 1,
  "word_count": 12,
  "visibility": "private",
  "template": null,
  "branding_id": null
}

Utwórz dokument

curl -s -X POST https://my.clarife.app/api/v1/documents \
  -H "Authorization: Bearer clrf_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Nowy tutorial",
    "description": "Instrukcja konfiguracji",
    "project_id": "p1234567-...",
    "visibility": "private"
  }' | jq
Parametry body:
PoleTypWymaganeOpis
titlestringnieTytuł (max 500 znaków, domyślnie “Untitled”)
descriptionstringnieOpis (max 2000 znaków)
contentobjectnieObiekt z meta i blocks
project_iduuidniePrzypisz do projektu
templatestringnieIdentyfikator szablonu
visibilitystringnieprivate lub workspace (wymaga X-Workspace-Id)
Odpowiedź 201 Created:
{
  "id": "d1234567-...",
  "title": "Nowy tutorial",
  "created_at": "2026-03-28T12:00:00Z"
}

Zaktualizuj dokument

curl -s -X PATCH https://my.clarife.app/api/v1/documents/DOCUMENT_ID \
  -H "Authorization: Bearer clrf_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Zmieniony tytuł",
    "description": "Zaktualizowany opis"
  }' | jq
Parametry body:
PoleTypOpis
titlestringNowy tytuł (max 500 znaków)
descriptionstringNowy opis (max 2000 znaków)
contentobjectNowa treść z blokami
Odpowiedź 200 OK:
{
  "id": "d1234567-...",
  "title": "Zmieniony tytuł",
  "updated_at": "2026-03-28T13:00:00Z"
}

Usuń dokument

Usuwanie jest miękkie (soft delete) — dokument trafia do kosza na 30 dni.
curl -s -X DELETE https://my.clarife.app/api/v1/documents/DOCUMENT_ID \
  -H "Authorization: Bearer clrf_xxxxx" | jq
Odpowiedź 200 OK:
{
  "id": "d1234567-...",
  "deleted": true
}

Kody błędów

KodOpis
NOT_FOUNDDokument nie istnieje lub brak dostępu
VALIDATION_ERRORNieprawidłowe dane wejściowe
PLAN_LIMIT_REACHEDOsiągnięto limit dokumentów na planie
FORBIDDENBrak uprawnień w workspace