Versions in this module Expand all Collapse all v0 v0.3.2 Sep 17, 2026 v0.3.1 Sep 14, 2026 v0.3.0 Sep 14, 2026 Changes in this version type Client + func (c *Client) AddDocumentNote(ctx context.Context, documentID int, note string) ([]DocumentNote, error) + func (c *Client) CreateSavedView(ctx context.Context, req CreateSavedViewRequest) (int, error) + func (c *Client) CreateShareLink(ctx context.Context, req CreateShareLinkRequest) (ShareLink, error) + func (c *Client) DeleteDocumentNote(ctx context.Context, documentID, noteID int) ([]DocumentNote, error) + func (c *Client) DeleteSavedView(ctx context.Context, viewID int) error + func (c *Client) DeleteShareLink(ctx context.Context, linkID int) error + func (c *Client) ListDocumentNotes(ctx context.Context, documentID int) ([]DocumentNote, error) + func (c *Client) ListSavedViews(ctx context.Context) ([]SavedView, error) + func (c *Client) ListShareLinks(ctx context.Context) ([]ShareLink, error) + type CreateSavedViewRequest struct + FilterRules []SavedViewFilterRule + Name string + ShowInSidebar bool + ShowOnDashboard bool + SortField string + SortReverse bool + type CreateShareLinkRequest struct + DocumentID int + Expiration *time.Time + FileVersion ShareLinkFileVersion + type DocumentNote struct + Created time.Time + ID int + Note string + User *DocumentNoteUser + type DocumentNoteUser struct + FirstName string + ID int + LastName string + Username string + type SavedView struct + FilterRules []SavedViewFilterRule + ID int + Name string + ShowInSidebar bool + ShowOnDashboard bool + SortField string + SortReverse bool + type SavedViewFilterRule struct + RuleType int + Value string + type ShareLink struct + Created time.Time + DocumentID int + Expiration time.Time + FileVersion ShareLinkFileVersion + ID int + Slug string + type ShareLinkFileVersion string + const ShareLinkFileVersionArchive + const ShareLinkFileVersionOriginal v0.2.0 Sep 13, 2026 Changes in this version + const DefaultRetryInitialDelay + const DefaultRetryMaxAttempts + const DefaultRetryMaxDelay + const DefaultRetryMultiplier + const DefaultTaskPollInterval type Client + func (c *Client) EnsureStoragePath(ctx context.Context, name, path string) (int, error) + func (c *Client) FindStoragePath(ctx context.Context, name string) (int, bool, error) + func (c *Client) ListStoragePaths(ctx context.Context) ([]StoragePath, error) + func (c *Client) WaitForTask(ctx context.Context, taskID string, interval time.Duration) (TaskOutcome, error) type Option + func WithRequestHook(hook func(RequestInfo)) Option + func WithResponseHook(hook func(ResponseInfo)) Option + func WithRetry(policy RetryPolicy) Option + type RequestInfo struct + Header http.Header + Method string + URL string + type ResponseInfo struct + Body []byte + Header http.Header + Status int + type RetryPolicy struct + InitialDelay time.Duration + MaxAttempts int + MaxDelay time.Duration + Multiplier float64 + type StoragePath struct + ID int + Name string + Path string + Slug string type TaskOutcome + func (o TaskOutcome) Duplicate() (documentID int64, inTrash, refused bool) v0.1.1 Sep 13, 2026 v0.1.0 Sep 13, 2026 Changes in this version + const DefaultIdleConnTimeout + const DefaultMaxIdleConns + const DefaultMaxIdleConnsPerHost + var ErrInvalidConfig = errors.New("paperless: base URL and token are required") + type Capabilities struct + AcceptAPIVersion string + DocumentsSampled int + FlatChecksum bool + VersionedChecksum bool + func (c Capabilities) ChecksumShape() string + type Client struct + func New(baseURL, token string, opts ...Option) (*Client, error) + func (c *Client) DeleteDocument(ctx context.Context, documentID int) error + func (c *Client) DownloadDocument(ctx context.Context, documentID int) ([]byte, error) + func (c *Client) EnsureCorrespondent(ctx context.Context, name string) (int, error) + func (c *Client) EnsureCustomField(ctx context.Context, name string) (int, error) + func (c *Client) EnsureDocumentType(ctx context.Context, name string) (int, error) + func (c *Client) EnsureTag(ctx context.Context, name string) (int, error) + func (c *Client) FindCustomField(ctx context.Context, name string) (int, bool, error) + func (c *Client) GetCorrespondentName(ctx context.Context, id int) (string, error) + func (c *Client) GetDocumentTypeName(ctx context.Context, id int) (string, error) + func (c *Client) GetTask(ctx context.Context, taskID string) (TaskOutcome, bool, error) + func (c *Client) ListDocumentChecksums(ctx context.Context) (map[string]struct{}, error) + func (c *Client) ListDocumentMetas(ctx context.Context) ([]DocumentMeta, error) + func (c *Client) Ping(ctx context.Context) error + func (c *Client) ProbeCapabilities(ctx context.Context) (Capabilities, error) + func (c *Client) UpdateDocument(ctx context.Context, documentID int, req UpdateDocumentRequest) error + func (c *Client) Upload(ctx context.Context, req UploadRequest) (string, error) + type CustomFieldValue struct + Field int + Value string + type DocumentMeta struct + Checksum string + Correspondent int + Created time.Time + CustomFields []CustomFieldValue + DocumentTypeID int + ID int + TagIDs []int + Title string + type Option func(*Client) + func WithHTTPClient(client *http.Client) Option + func WithTimeout(timeout time.Duration) Option + type RetryAfterError struct + After time.Duration + Err error + func (e *RetryAfterError) Error() string + func (e *RetryAfterError) Unwrap() error + type TaskOutcome struct + DocumentID int64 + DuplicateInTrash bool + DuplicateRefused bool + ErrorMessage string + Status TaskStatus + type TaskStatus string + const TaskStatusFailure + const TaskStatusPending + const TaskStatusStarted + const TaskStatusSuccess + func (s TaskStatus) Terminal() bool + type UpdateDocumentRequest struct + CorrespondentID *int + Created *time.Time + CustomFields []CustomFieldValue + DocumentTypeID *int + TagIDs []int + Title *string + type UploadRequest struct + Content []byte + CorrespondentID int + Created time.Time + CustomFields []CustomFieldValue + DocumentTypeID int + Filename string + TagIDs []int + Title string