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" | jqParametry query:
| Parametr | Typ | Opis |
|---|---|---|
| limit | integer | Wyniki na stronę (1-100) |
| offset | integer | Przesunięcie paginacji |
| document_id | uuid | Filtruj 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" | jqUtwó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"
}' | jqParametry body:
| Pole | Typ | Wymagane | Opis |
|---|---|---|---|
| document_id | uuid | tak | ID dokumentu do udostępnienia |
| view_style | string | nie | minimalistic (domyślne) lub with_navigation |
| show_branding | boolean | nie | Pokaż własny branding (plan Business) |
| password | string | nie | Hasło dostępu (plany płatne) |
| allowed_emails | string[] | nie | Lista dozwolonych adresów email (plany płatne) |
| allowed_domains | string[] | nie | Lista dozwolonych domen email (plany płatne) |
| embed_allowed | boolean | nie | Zezwalaj na osadzanie (plany płatne) |
| embed_type | string | nie | iframe, widget lub popup |
| branding_id | uuid | nie | ID 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
}' | jqParametry body:
| Pole | Typ | Opis |
|---|---|---|
| is_active | boolean | Włącz/wyłącz link |
| password | string|null | Nowe hasło lub null aby usunąć |
| allowed_emails | string[] | Zaktualizuj listę dozwolonych emaili |
| allowed_domains | string[] | Zaktualizuj listę dozwolonych domen |
| expires_at | string|null | Data wygaśnięcia (ISO 8601) lub null aby usunąć |
| show_branding | boolean | Przełącz własny branding |
| branding_id | uuid|null | Ustaw lub usuń branding |
| embed_allowed | boolean | Przełącz osadzanie |
| embed_type | string|null | Typ osadzania |
| view_style | string | Styl 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.