API Reference
Quick reference table for all SDK methods.
Method Reference
| Method | HTTP | Path | Returns |
|---|---|---|---|
sdk.documents.list(params?) | GET | /api/sdk/v1/documents | ListDocumentsResponse |
sdk.documents.get(id) | GET | /api/sdk/v1/documents/:id | Document |
sdk.documents.download(id) | GET | /api/sdk/v1/documents/:id/download | DownloadResponse |
sdk.documents.getDownloadUrl(id, params?) | GET | /api/sdk/v1/documents/:id/download-url | DownloadUrlResponse |
sdk.documents.upload(params) | POST | /api/sdk/v1/documents/upload | Document |
sdk.documents.delete(id) | DELETE | /api/sdk/v1/documents/:id | DeleteDocumentResponse |
sdk.documents.batchDelete(params) | POST | /api/sdk/v1/documents/delete | BatchDeleteResponse |
sdk.documents.export(params) | POST | /api/sdk/v1/documents/export | DownloadResponse |
sdk.documents.getSignatureChain(id) | GET | /api/sdk/v1/documents/:id/signature-chain | SignatureChain |
sdk.scopes.getAllowed() | GET | /api/sdk/v1/scopes-allowed | AllowedScopesResponse |
sdk.scopes.getAll() | GET | /api/sdk/v1/scopes-allowed/all | ScopeCategory[] |
Base Path
All resource endpoints are under /api/sdk/v1/:
| Resource | Base Path |
|---|---|
| Documents | /api/sdk/v1/documents |
| Scopes | /api/sdk/v1/scopes-allowed |
Response Envelope
The Sonar API wraps successful responses in a standard envelope:
{ "success": true, "data": { ... }, "message": "Optional message"}The SDK automatically unwraps this envelope — you always receive the data payload directly. For binary responses (downloads, exports), the raw ArrayBuffer is returned as-is.
Date Handling
When fromDate or toDate parameters receive a Date object, the SDK automatically converts it to an ISO 8601 string via .toISOString(). String values are passed through as-is.