API Udostępnień

Linki udostępniania pozwalają współdzielić dokumenty z innymi osobami pod adresem clarife.app/s/{slug}. Płatne plany odblokowują ochronę hasłem, bramkę email/domenową i osadzanie.

Wymagane scopy: shares:read, shares:write

Lista udostępnień

bash
curl -s "https://my.clarife.app/api/v1/shares?limit=10" \
  -H "Authorization: Bearer clrf_xxxxx" | jq

Parametry query:

ParametrTypOpis
limitintegerWyniki na stronę (1-100)
offsetintegerPrzesunięcie paginacji
document_iduuidFiltruj po dokumencie

Odpowiedź 200 OK:

json
{
  "data": [
    {
      "id": "s1234567-...",
      "slug": "aBcDeFgH12345678",
      "document_id": "d1234567-...",
      "view_style": "minimalistic",
      "show_branding": false,
      "is_active": true,
      "has_password": false,
      "allowed_emails": [],
      "allowed_domains": [],
      "expires_at": null,
      "embed_allowed": false,
      "embed_type": null,
      "view_count": 42,
      "unique_viewers": 15,
      "last_viewed_at": "2026-03-28T12:00:00Z",
      "branding_id": null,
      "created_at": "2026-03-20T10:00:00Z"
    }
  ],
  "total": 3,
  "limit": 10,
  "offset": 0
}

ℹ️ Informacja: Pole has_password informuje, czy udostępnienie jest chronione hasłem. Hash hasła nigdy nie jest zwracany.

Pobierz udostępnienie

bash
curl -s https://my.clarife.app/api/v1/shares/SHARE_ID \
  -H "Authorization: Bearer clrf_xxxxx" | jq

Utwórz udostępnienie

bash
curl -s -X POST https://my.clarife.app/api/v1/shares \
  -H "Authorization: Bearer clrf_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "document_id": "d1234567-...",
    "view_style": "minimalistic",
    "password": "tajneHaslo123",
    "allowed_emails": ["jan@firma.pl"],
    "embed_allowed": true,
    "embed_type": "iframe"
  }' | jq

Parametry body:

PoleTypWymaganeOpis
document_iduuidtakID dokumentu do udostępnienia
view_stylestringnieminimalistic (domyślne) lub with_navigation
show_brandingbooleanniePokaż własny branding (plan Business)
passwordstringnieHasło dostępu (plany płatne)
allowed_emailsstring[]nieLista dozwolonych adresów email (plany płatne)
allowed_domainsstring[]nieLista dozwolonych domen email (plany płatne)
embed_allowedbooleannieZezwalaj na osadzanie (plany płatne)
embed_typestringnieiframe, widget lub popup
branding_iduuidnieID brandingu (plan Business)

Odpowiedź 201 Created:

json
{
  "data": {
    "id": "s1234567-...",
    "slug": "aBcDeFgH12345678",
    "document_id": "d1234567-...",
    "view_style": "minimalistic",
    "show_branding": false,
    "is_active": true,
    "embed_allowed": true,
    "embed_type": "iframe",
    "view_count": 0,
    "unique_viewers": 0,
    "created_at": "2026-03-28T12:00:00Z"
  }
}

Link udostępniania: https://clarife.app/s/aBcDeFgH12345678

Zaktualizuj udostępnienie

bash
curl -s -X PATCH https://my.clarife.app/api/v1/shares/SHARE_ID \
  -H "Authorization: Bearer clrf_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "is_active": false,
    "password": null
  }' | jq

Parametry body:

PoleTypOpis
is_activebooleanWłącz/wyłącz link
passwordstring|nullNowe hasło lub null aby usunąć
allowed_emailsstring[]Zaktualizuj listę dozwolonych emaili
allowed_domainsstring[]Zaktualizuj listę dozwolonych domen
expires_atstring|nullData wygaśnięcia (ISO 8601) lub null aby usunąć
show_brandingbooleanPrzełącz własny branding
branding_iduuid|nullUstaw lub usuń branding
embed_allowedbooleanPrzełącz osadzanie
embed_typestring|nullTyp osadzania
view_stylestringStyl widoku

Usuń udostępnienie

Usunięcie jest trwałe. Link natychmiast przestaje działać.

bash
curl -s -X DELETE https://my.clarife.app/api/v1/shares/SHARE_ID \
  -H "Authorization: Bearer clrf_xxxxx"

Odpowiedź: 204 No Content - bez treści.